Problems with saving as pdf

Post questions on how to use or achieve an effect in Inkscape.
carmvyg
Posts: 6
Joined: Wed Jan 31, 2018 12:12 am

Problems with saving as pdf

Postby carmvyg » Wed Jan 31, 2018 1:40 am

Hi,

I'm having lots of problems saving as pdf. The Version is 0.91 on Win 7 64. I can not delete the preferences.xml as I work on University computers w/o admin priviledges.
I don't have the black background problem and I don't use (to my knowledge) opacity:
On MS Windows, 64bit Inkscape builds, printing may result in mostly black pages when partial opacity is used in the document


What I'm trying to do is to export figures from scanned documents which are usually rasterized or vector.

Problem 1:
Method: Import pdf --> ungroup --> extract the wanted figure --> save as pdf --> results in blank pdf

If I save as svg I can open it again in Inkscape and it shows just fine. The file is too large to attach and it gets even larger if I crop it as the raster is blurred.

Problem 2:
Method: Import pdf (attached
scan.pdf
(48.21 KiB) Downloaded 169 times
) --> draw box over wanted figure --> cut path --> save as pdf --> results in white and greyish pattern (attached
test.pdf
(75.94 KiB) Downloaded 167 times
)


Ideas? Maybe Inkscape is not the right tool?

Any help appreciated.

Best,
Chris

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

Re: Problems with saving as pdf

Postby Moini » Wed Jan 31, 2018 4:03 am

Removing the preferences wouldn't help, but they are saved per user, so they should be accessible to you.

What will help is removing clips and masks, or ungrouping as often as possible, which also removes clips and masks, in most cases.

In your pdf, however, there is a color-inverted raster image, not a vector image, so I'm not really sure why you need to use any procedure that preserves vector data - there is no vector data to preserve. You can just export the area you need, as a png image, or - even better, as it keeps the original resolution and size of the raster image - extract the image (right-click, extract image), invert it back to positive from negative using any raster graphics editor, and turn that to pdf, if it must be a pdf.
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)

carmvyg
Posts: 6
Joined: Wed Jan 31, 2018 12:12 am

Re: Problems with saving as pdf

Postby carmvyg » Wed Jan 31, 2018 4:49 am

Thanks for the quick reply!
You're right, using a raster editor works for problem 2.

For problem 1 it seems like Acrobat Reader just does't recognize the raster graphics in certain pdf files. But, they can be extracted using other viewers under Ubuntu.
I'm still wondering if there is a way to extract embedded raster images from pdf in the native resolution using Inkscape (because I don't have Ubuntu). Or maybe a workaround.

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

Re: Problems with saving as pdf

Postby brynn » Wed Jan 31, 2018 5:10 am

Since it sounds like the main goal is to extract something from the PDF, I wonder if it's necessary to re-save as PDF. Does it somehow take the PDF of its directory, when you open it in Inkscape? So that if you don't save a new one, it should still be there as before.

Or is the updated PDF more of a main goal than you indicated? Or do you mean that the extracted content has to be a PDF?

You posted while I was typing. I can't answer your last questions. Edit - well, unless my suggestion helps.

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

Re: Problems with saving as pdf

Postby brynn » Wed Jan 31, 2018 5:19 am

Actually I'm not clear what Problem #2 is. I see the 2 PDFs.....well, maybe if I open in Inkscape it will make sense.... Hmm, not so much.

What is it that you're trying to use Path menu > Cut Path, on?

carmvyg
Posts: 6
Joined: Wed Jan 31, 2018 12:12 am

Re: Problems with saving as pdf

Postby carmvyg » Wed Jan 31, 2018 5:56 am

brynn wrote:Since it sounds like the main goal is to extract something from the PDF, I wonder if it's necessary to re-save as PDF.

No, it's not.

brynn wrote:Does it somehow take the PDF of its directory, when you open it in Inkscape?

If I open and save I lose all the raster pictures --> problem 1 (see
test2.pdf
(40.8 KiB) Downloaded 165 times
). But I can see them in Inkscape and export as blurry svg.
If I ungroup everything and export the image to pdf it is blank. Save as png is also blank white, export to png is completely black.

brynn wrote:Does it somehow take the PDF of its directory, when you open it in Inkscape? So that if you don't save a new one, it should still be there as before.

I'm not sure what you mean but the original file is not altered.

For clarification:
Problem 2 is solved: copy embedded raster image in Acrobat Reader and use a raster editor.

Problem 1 is still open. Unfortunately I can not attach the original pdf because of copyright.

carmvyg
Posts: 6
Joined: Wed Jan 31, 2018 12:12 am

Re: Problems with saving as pdf

Postby carmvyg » Wed Jan 31, 2018 6:01 am

Oh sorry I messed up the quotes.

I wonder if it's necessary to re-save as PDF.
--> No, it's not.

So that if you don't save a new one, it should still be there as before.
--> If I open and save I lose all the raster pictures

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

Re: Problems with saving as pdf

Postby Moini » Wed Jan 31, 2018 8:37 am

> I'm still wondering if there is a way to extract embedded raster images from pdf in the native resolution using Inkscape (because I don't have Ubuntu).
> Or maybe a workaround.

I described how to do it above:

"even better, as it keeps the original resolution and size of the raster image - extract the image (right-click, extract image), invert it back to positive from negative using any raster graphics editor, and turn that to pdf, if it must be a pdf."

You must do the ungrouping / mask removal first, to be able to access the image - or you can use the Object > Objects dialog to select it more easily.
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)

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

Re: Problems with saving as pdf

Postby brynn » Wed Jan 31, 2018 9:14 am

Well, partly I left out a word or 2 (trying to type too fast, I guess), causing you to misunderstand me; and partly I misunderstood your problems. This is what I thought you were doing.

Open the PDF in Inkscape
Copy some contents -- or -- export PNG
Save the original PDF as PDF
Paste the copied contents into a different file -- or go and find the exported PNG

So my first thought was, if saving as PDF is a problem, and your only goal is to extract some contents, then why bother trying to save it. Just close the file without saving. Then you can either paste whatever you had copied into another file, or you can go and locate the exported PNG.

However, maybe you mean that the contents you copied need to be saved as PDF. If that's the case, I can only echo Moini, and suggest getting rid of as many clips, masks, and groups, as possible.

In some cases, clips and masks are vital to the image, and can't be removed. But when any kind of file format conversion is involved (PDF to SVG in this case), we often see extra groups and/or clips as a result of the conversion. Sometimes removing those extra clips and/or groups will solve the problem.

I never did understand Problem #2, so I'm glad it's solved!

This last thought is probably moot, at this point. But just in case. It does surprise me that PDF is being used for images which are scanned in. But perhaps that's because they are mostly text documents? If that's the case, nevermind. But if it doesn't matter, and none of the other solutions are successful, maybe you could start out by saving the scanned image in some other format?

carmvyg
Posts: 6
Joined: Wed Jan 31, 2018 12:12 am

Re: Problems with saving as pdf

Postby carmvyg » Wed Jan 31, 2018 9:43 pm

Moini wrote:I described how to do it above:
"even better, as it keeps the original resolution and size of the raster image - extract the image (right-click, extract image), invert it back to positive from negative using any raster graphics editor, and turn that to pdf, if it must be a pdf."
You must do the ungrouping / mask removal first, to be able to access the image - or you can use the Object > Objects dialog to select it more easily.


Yeah great that's it.
I thought you mean to extract the image in the pdf viewer (which doesn't recognize the image) and didn't see the option in Inkscape :roll:


> It does surprise me that PDF is being used for images which are scanned in. But perhaps that's because they are mostly text documents?
I'm working with printed scientific journals which were scanned to pdf with text recognition and the (few) figures are embedded as raster images. It's the way old books etc are digitized.

Thanks guys!

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

Re: Problems with saving as pdf

Postby Moini » Thu Feb 01, 2018 7:36 am

You're welcome :)
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”