Drawing extent of imported PDF file larger than expected

Bug #1474710 reported by Ryo Furue
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

When I open an existing PDF file, I find Inkscape's canvas is too large. It's so large that I get lost when I scroll and never find my objects again which I wanted to edit. Please make the default canvas narrow, preferable setting it according to the file you open.

I think I reported the same problem many years ago and the canvas seems to have been improved. But, today I switched from 0.48 to 0.91 and found the problem again. Mac OS 10.10.4 .

Ryo

Tags: importing pdf
Revision history for this message
su_v (suv-lp) wrote :

Please clarify what is actually "too big" specifically when opening PDF files in Inkscape 0.91.

1) The Canvas: the canvas area is always the same, independent of the source of the drawing/document - it generally refers to the entire drawing area (while 'Page' refer to a specified region of the Canvas corresponding to a defined output area). This has not changed in Inkscape 0.91.

2) The Page area of a PDF document opened in Inkscape is taken from the PDF document - this has not changed in Inkscape 0.91, and is not in control of Inkscape - it's how the PDF file was created. This has not changed in Inskcape 0.91.

3) The document Window: the initial size of the Inkscape document window when opening file formats other than Inkscape SVG is taken from the template stored in the preferences (initial default document window width: 640, default document window height: 480 [1]). There is no GUI to edit this default template skeleton, but you could edit the preferences file in a plain-text editor and change it if a different document window size is preferred. This has not changed in Inkscape 0.91.

4) The document window size may also be influenced by the user's settings in 'Edit > Preferences > Interface > Windows' (in earlier versions of Inkscape, this would have been in 'File > Inkscape preferences > Windows').

5) The document window size for new (empty) Inkscape documents: a noticeable change in 0.91 (compared to 0.48) is that the default size of a _new_ (empty Inkscape SVG) document is now 'maximized' (on popular demand, as tracked in bug #830663) - the user can change this behavior in 'Preferences > Interface > Windows > Default window size' ('Small' will restore the behavior of 0.48, 'Medium' will use a window size of 75% relative to the screen size as reported by Gtk+ to Inkscape [2]).

Tip: Note that Inkscape comes with predefined view / zoom shortcuts, and that typing '5' will always zoom to the page area, '4' will zoom to the extents of the drawing content, and '3' to the current selection if one exists. These presets (also available menu 'View > Zoom', and on the controls bar of the Zoom tool) may help in case you got lost and scrolled the canvas area far off from any visible drawing content).

On 2015-07-15 09:18 (+0200), Ryo Furue wrote:
> (...) Mac OS 10.10.4 .

Just curious - do you use a multi-screen setup? There is a known incompatibility of XQuartz with OS X Mavericks and later (tracked for Inkscape in bug #1244397) which may affect window position (and possibly also screen sizes as reported by Gtk+ from XQuartz) - according to the main XQuartz developer, turning off "Displays have separate spaces" in Mission Control can help if you need to use X11 across multiple displays.

--
[1] http://bazaar.launchpad.net/~inkscape.dev/inkscape/RELEASE_0_91_BRANCH/view/head:/src/preferences-skeleton.h#L60
[2] http://bazaar.launchpad.net/~inkscape.dev/inkscape/RELEASE_0_91_BRANCH/view/head:/src/sp-namedview.cpp#L759
   http://bazaar.launchpad.net/~inkscape.dev/inkscape/RELEASE_0_91_BRANCH/view/head:/src/sp-namedview.cpp#L828

Changed in inkscape:
status: New → Incomplete
tags: added: importing pdf ui
Revision history for this message
Ryo Furue (furue) wrote :

a) First of all, thank you for your prompt response!

b) Second, my terminology may have been wrong. What I meant by "canvas" was the area where you can scroll in. If you show the scroll bars, you know where you are within that area. I don't know what this area is called in Inkscape. (Is it "work area"?)

You can go to far right, far left, far up, and far down within that area; and you lose the sight of your drawing.

Revision history for this message
Ryo Furue (furue) wrote :

Sorry, how can I edit my post? I accidentally posted it prematurely.

a) First of all, thank you for your prompt response!

b) Second, my terminology may have been wrong. What I meant by "canvas" was the area where you can scroll in. If you show the scroll bars, you know where you are within that area. I don't know what this area is called in Inkscape. (Is it "work area"?)

You can go to far right, far left, far up, and far down within that area; and you lose the sight of your drawing.

c) I was wrong that that area is huge only in 0.91; I've just tested it with 0.48 (0.49?) and the area is huge.

I attached a sample file in my previous post.

Sorry I haven't read your comments carefully but I thought it's more productive if I correct my errors first and give you a sample.

Ryo

su_v (suv-lp)
Changed in inkscape:
status: Incomplete → New
Revision history for this message
su_v (suv-lp) wrote :

The SVG structure resulting from converting the PDF file contains this huge rectangular path (no fill, and a white stroke -> not visible on a white canvas area):

Snippet from pdftocairo output:
<path style="fill:none;stroke-width:0.03;stroke-linecap:square;stroke-linejoin:miter;stroke:rgb(99.998474%,99.998474%,99.998474%);stroke-opacity:1;stroke-miterlimit:10;" d="M -8000066 8000185 L 7999934 8000185 L 7999934 -7999815 L -8000066 -7999815 Z M -8000066 8000185 " transform="matrix(1,0,0,-1,0,180)"/>

Snippet from Inkscape's own PDF importer:
         <path
         id="path16"
         style="fill:none;stroke:#ffffff;stroke-width:0.03;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
         d="m -8000066,8000185 16000000,0 0,-16000000 -16000000,0 0,16000000 z" />

which is even larger than what Inkscape can display at max zoom out level (1%). As far as I understand, inkscape's scrollbars are correctly reflecting drawing extents of the content imported from the PDF.

Poppler's pdftocairo produces the same output so it does not seem specific to Inkscape's own PDF importer either.

--
Note: some of the values differ between Inkscape's SVG output and pdftocairo SVG output because the two convertors create different document drawing scales (SVG width, height to viewBox), and the paths are inside groups which themselves may have transforms applied (not part of the pasted snippets).

tags: removed: ui
Revision history for this message
su_v (suv-lp) wrote : Re: [Bug 1474710] [NEW] canvas too big

The snippets with just the group containing
* a page-sized rectangle/rectangular path with solid white fill
* a huge rectangular path with no fill and solid white stroke
as resulting from converting the PDF test case to SVG attached as
standalone SVG files for easier inspection e.g. with Inkscape.

Revision history for this message
Ryo Furue (furue) wrote : Re: canvas too big

I'm not sure if this information is of any help, but the PDF file in question displays correctly without any extra huge margin on Preview Adobe Reader, Skim, gv, and Chrome's PDF viewer plugin. So, I guess that means that there is some problem with the PDF to SVG converter. (Mac OS 10.10.4).

Revision history for this message
su_v (suv-lp) wrote :

The imported PDF file displays correctly in Inkscape too, and Inkscape sets the page size (the defined output area) also correctly. Independent of this the PDF seems top contain a huge element which extends beyond the defined page size, and is not clipped by any of the usual PDF boxes (media, crop, etc.) - I tried them all (see Inkscape's PDF import options, near the top).

PDF viewers are not editors, and thus can limit the displayed area to the page size easily - Inskcape on the other hand is a an editor (albeit not a PDF editor), and thus only limits the extent of the drawing content on output.

Anyway - I can't read PDFs myself, so this report will have to wait until someone with skills to interpret PDF data independent of poppler, cairo and Inkscape can investigate whether or not poppler/cairo is correct to include that path unclipped (at its original size) or not.

Would you mind sharing details about the creator software of the PDF file?

Revision history for this message
Ryo Furue (furue) wrote :

> The imported PDF file displays correctly in Inkscape too,
> and Inkscape sets the page size (the defined output area)
> also correctly. Independent of this the PDF seems
> to contain a huge element which extends beyond
> the defined page size, and is not clipped
> by any of the usual PDF boxes (media, crop, etc.)
> - I tried them all (see Inkscape's PDF import options,
> near the top).

I wonder how Inkscape gets the "page size". If it knows it, it can clip the huge object to the page size, can't it?

> Would you mind sharing details about the creator software of the PDF file?

It must have come originally from Mathematica. The author of the figure gave me an EPS version and a PDF version. The EPS says "%%Creator: (Wolfram Mathematica 10.0 for Microsoft Windows (32-bit) (July 1, 2014))" whereas the PDF version says

   Creator: cairo 1.12.16 (http://cairographics.org)
   Producer: cairo 1.12.16 (http://cairographics.org)

(according to the pdfinfo command on the PDF file). That suggests that the author or Mathematica uses cairo to generate it or convert the EPS to PDF.

Ryo

su_v (suv-lp)
summary: - canvas too big
+ Drawing extent of imported PDF file larger than expected
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.