Problem with modifying a specific .pdf file

Post questions on how to use or achieve an effect in Inkscape.
Niels
Posts: 3
Joined: Wed Jun 13, 2018 6:10 pm

Problem with modifying a specific .pdf file

Postby Niels » Wed Jun 13, 2018 6:30 pm

Hi all,

I have many figures similar to the attached Test1.pdf that I want to format/modify in inkscape (because in inkscape I can easily ungroup the whole pdf and move/remove objects freely) . Because I have a very basic problems I attached here 3 very straighforward examples: Test1, Test2 and Test3.

Test1 is how the original file looks like that I want to import into inkscape using the Poppler/Cairo import (I don't use the internal import because if I then save it again as a .pdf, all the data points are gone, it just exports empty graphs). After import, if I do not modify anything and I save it directly as a .pdf it looks like Test2.pdf, which looks a bit different than the original but still acceptable. When I do slight modifications: ungroup the object, move each graph to a different place, group them again and then save to .pdf, it looks like Test3 which is really not how it should look like.

There is some kind of blur in the data points in the graphs and I don't know how it got there and how to get rid of it.

I would be happy if anybody has a suggestion what I should do.

Thanks!!
Attachments
Test1.pdf
(42.49 KiB) Downloaded 10 times
Test3.pdf
(93.26 KiB) Downloaded 4 times
Test2.pdf
(139.98 KiB) Downloaded 2 times

User avatar
brynn
Posts: 9835
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Problem with modifying a specific .pdf file

Postby brynn » Thu Jun 14, 2018 1:45 pm

Either I don't understand the problem, or I can't reproduce it.

When you said you opened the file, ungrouped and moved some graphs, do you mean that where you moved them, is not where we see them, in Test3.pdf?

Attached is what I see in Test3.pdf, using Adobe Reader.
Attachments
test3.png
test3.png (48.11 KiB) Viewed 188 times

Niels
Posts: 3
Joined: Wed Jun 13, 2018 6:10 pm

Re: Problem with modifying a specific .pdf file

Postby Niels » Thu Jun 14, 2018 4:41 pm

Yes, I see the same as what you posted. So the problem is that the quality is very low. In Test1 you can see the individual dots and in Test3 everything is blurry.

tylerdurden
Posts: 2010
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Problem with modifying a specific .pdf file

Postby tylerdurden » Thu Jun 14, 2018 10:14 pm

Here's how I would proceed:

Open the original PDF using Internal import.
Ungroup everything repeatedly, until no more groups.
Clean the document (Menu: File>Clean up document)
Select the top chart image, it will say "Path 4 nodes" or such since it uses the image as a pattern fill.
Make a bitmap copy (Alt+B) of the selected chart and delete the original chart (Path 4 nodes) from underneath.
Repeat for the other charts.
Group the desired objects to move them about.
Save SVG as new file.
Save copy as pdf.

If the file crashes when saving as PDF, an original chart with image-pattern fill is still in the document and needs to be deleted.

Poppler Import vs. Internal
Image

https://www.dropbox.com/s/emlzi6miyn5k0 ... d.pdf?dl=0
Last edited by tylerdurden on Fri Jun 15, 2018 1:34 am, edited 1 time in total.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Polygon
Posts: 276
Joined: Thu Dec 19, 2013 3:27 am

Re: Problem with modifying a specific .pdf file

Postby Polygon » Thu Jun 14, 2018 10:40 pm

Could it have probably something to do with rendering (shift+cmd+O)->Image rendering: OptimizeSpeed instead of optimizeQuality?

Cheers
P.

tylerdurden
Posts: 2010
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Problem with modifying a specific .pdf file

Postby tylerdurden » Thu Jun 14, 2018 10:50 pm

Maybe, but the screwy architecture of masks and images in the defs makes me think it isn't a simple issue (which Poppler seems to make even worse).
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Moini
Posts: 2571
Joined: Mon Oct 05, 2015 10:44 am

Re: Problem with modifying a specific .pdf file

Postby Moini » Fri Jun 15, 2018 11:59 pm

For me, at least the first one is an image, not a pattern - but it's clipped, then masked, and only 256x256 px. So, yes, this is, in essence, an 'optimizeSpeed' vs. 'OptimizeQuality' issue.
The best way to fix this would be to export at a higher resolution from whatever plot program you are using.

Due to the mask, though, there's no way removing the mask can work, so to fix this, one would have to:
- ungroup the whole drawing once
- select the plot (Clone of image embedded + masked)
- release mask
- select mask and image below, both are clones (you may need to move the mask to the side or use Alt+Scrollwheel)
- unlink the clones
- right-click on both images, select 'Object properties', set the Image Rendering to 'optimize speed'
- reapply the mask
- now, it looks pixelated and crisp in Inkscape
- somehow, the pixelation isn't respected when I export it to pdf in my pdf viewers, but maybe it is in yours...
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Niels
Posts: 3
Joined: Wed Jun 13, 2018 6:10 pm

Re: Problem with modifying a specific .pdf file

Postby Niels » Sun Jun 17, 2018 5:10 pm

Thanks a lot for your suggestions!

I tried it but when I make a bitmap copy the quality is extremely low. Your output is the image on the right? As soon as I make a bitmap copy the quality looks by far not as good as what you uploaded.

Is there a setting to keep a good quality when copying to bitmap?

Thanks!

Polygon
Posts: 276
Joined: Thu Dec 19, 2013 3:27 am

Re: Problem with modifying a specific .pdf file

Postby Polygon » Sun Jun 17, 2018 5:27 pm

Moini wrote:- right-click on both images, select 'Object properties', set the Image Rendering to 'optimize speed'

I believe you meant "OptimizeQuality" for the best rendering result and not OptimizeSpeed.

Cheers
P.

tylerdurden
Posts: 2010
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Problem with modifying a specific .pdf file

Postby tylerdurden » Sun Jun 17, 2018 9:18 pm

Niels wrote:Is there a setting to keep a good quality when copying to bitmap?

Yes, in the preferences menu: Bitmaps>Create>Resolution for Create Bitmap Copy...

Preferences_(Shift+Ctrl+P).png
Preferences_(Shift+Ctrl+P).png (41.09 KiB) Viewed 56 times

I have it set for 300 dpi for this case, assuming it will go to print.


TD
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Moini
Posts: 2571
Joined: Mon Oct 05, 2015 10:44 am

Re: Problem with modifying a specific .pdf file

Postby Moini » Sun Jun 17, 2018 10:24 pm

@Polygon: No, I meant optimizeSpeed. It's going to render a graphic crisp and blocky, which is what the user wants (instead of the blur that is created when Inkscape tries to upsample the image).
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Help with using Inkscape”

Who is online

Users browsing this forum: No registered users and 5 guests