SVG to PDF images not showing correct & background color iss

Post questions on how to use or achieve an effect in Inkscape.
christinama
Posts: 6
Joined: Thu Jul 23, 2015 11:22 am

SVG to PDF images not showing correct & background color iss

Postby christinama » Thu Jul 23, 2015 11:47 am

]Hello! I am not all that educated in inkscape so please give me a break here. I am trying to create a couple simple marketing tools for my company and on both images I seem to be having issues.

1. No matter how I save the svg when I put it into png or pdf the background color is not showing up at all. I attached the svg it is showing what it looks like with the background but the image is showing a white background.
Our Values Front.png
Should have a pink background
Our Values Front.png (21.54 KiB) Viewed 7311 times

2. I have 3 jpegs in the svg but for some reason only one of them appears shaded when saved as a pdf and you cannot read the image. When this is a png this does not happen. I had to take a screenshot of the pdf to attach because the pdf file was much to large no matter what I did.
forum social links.jpg
The 3rd image is shaded. Don't understand why
forum social links.jpg (106.21 KiB) Viewed 7311 times
the second image here is it actually saved as a png and how the top 3 images should look.
OUR VALUES BACK.png
Correct look
OUR VALUES BACK.png (19.63 KiB) Viewed 7311 times



Thank you so much for your help!
Christina

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

Re: SVG to PDF images not showing correct & background color

Postby brynn » Thu Jul 23, 2015 3:42 pm

You said you attached the SVG, but I don't see it. We'll probably need it, to figure out what's wrong. Otherwise we'll just be guessing.

For #1, you probably just need to draw a pink rectangle for the background. The canvas background color doesn't always carry through to exports. I'm not sure if it's a bug, or if the background color is only for one's personal preference for their drawing environment. But either way, the page-sized rectangle for the background will fix it.

For #2, the SVG would help us :D

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: SVG to PDF images not showing correct & background color

Postby ~suv » Thu Jul 23, 2015 6:08 pm

The document background color (as defined in the Document Properties dialog) is a custom Inkscape SVG feature (per document) which is only supported when exporting the Inkscape SVG file to PNG (via 'File > Export Bitmap Image' (<= Inkscape 0.48) or 'File > Export PNG Image' (Inkscape 0.91)), but not when saving a copy as PDF/PS/EPS or 'Cairo PNG'.

Requests to support this custom Inkscape feature for PDF export are tracked here:

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

Re: SVG to PDF images not showing correct & background color

Postby brynn » Thu Jul 23, 2015 7:06 pm

Thanks for the info ~suv :D

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: SVG to PDF images not showing correct & background color

Postby Lazur » Thu Jul 23, 2015 7:29 pm

My guessing is the mentioned svg-s were pulled together partly from other pdf files with embedded images.

~suv wrote:Please keep in mind: Inkscape is NOT a PDF editor (no matter how much you'd prefer to view it as such). Inkscape uses external libraries for reading PDF (poppler) (supported content of the PDF document is converted to SVG structure) and for writing PDF (cairo) (the SVG structure is output to a PDF surface). Round-trip editing a lossy (from Inkscape's perspective) foreign vector file format (PDF) in an SVG editor is not guaranteed to produce similar, let alone identical results. PDF was designed as display format (identical output on different output devices), not as data exchange or easily editable image format. PDFs can include data not supported by Inkscape at all (e.g. OCR text in this case, as far as I can tell). And yes, Inkscape often does not a good job when being used to round-trip edit PDF documents (especially when masks are involved, as in this case for the visual representations of the OCR'd text).


http://www.inkscapeforum.com/viewtopic.php?f=5&t=19077&p=72719#p72719

and/or you are trying to embed a raster image of a specific format and colour profile.
http://www.inkscapeforum.com/viewtopic.php?f=29&t=19083#p72804

For saving as pdf-s, even embedded png-s with alpha channel can cause problems if you try to re-open and edit.

christinama
Posts: 6
Joined: Thu Jul 23, 2015 11:22 am

Re: SVG to PDF images not showing correct & background color

Postby christinama » Fri Jul 24, 2015 12:56 am

~suv wrote:The document background color (as defined in the Document Properties dialog) is a custom Inkscape SVG feature (per document) which is only supported when exporting the Inkscape SVG file to PNG (via 'File > Export Bitmap Image' (<= Inkscape 0.48) or 'File > Export PNG Image' (Inkscape 0.91)), but not when saving a copy as PDF/PS/EPS or 'Cairo PNG'.

Requests to support this custom Inkscape feature for PDF export are tracked here:



I do appreciate this but I cannot even get the background to show up in the png. That is what I attached showing that it is white and not the light pink I had in the file. :D

christinama
Posts: 6
Joined: Thu Jul 23, 2015 11:22 am

Re: SVG to PDF images not showing correct & background color

Postby christinama » Fri Jul 24, 2015 1:01 am

brynn wrote:You said you attached the SVG, but I don't see it. We'll probably need it, to figure out what's wrong. Otherwise we'll just be guessing.

For #1, you probably just need to draw a pink rectangle for the background. The canvas background color doesn't always carry through to exports. I'm not sure if it's a bug, or if the background color is only for one's personal preference for their drawing environment. But either way, the page-sized rectangle for the background will fix it.

For #2, the SVG would help us :D


#1 - Thank you! I will certainly do the background that way! Much easier, don't know why I didn't do it that way in the first place. :)

#2 - I tried to attach the svg but it says that it is too large no matter how I save it. That is why I did the screenshot. It is 1,000 kb. I put it in dropbox so you can see it here. https://www.dropbox.com/s/t5ves0i0trxw1 ... K.svg?dl=0

Thank you so much Brynn
Last edited by christinama on Fri Jul 24, 2015 3:18 am, edited 1 time in total.

christinama
Posts: 6
Joined: Thu Jul 23, 2015 11:22 am

Re: SVG to PDF images not showing correct & background color

Postby christinama » Fri Jul 24, 2015 1:05 am

Lazur URH wrote:My guessing is the mentioned svg-s were pulled together partly from other pdf files with embedded images.

~suv wrote:Please keep in mind: Inkscape is NOT a PDF editor (no matter how much you'd prefer to view it as such). Inkscape uses external libraries for reading PDF (poppler) (supported content of the PDF document is converted to SVG structure) and for writing PDF (cairo) (the SVG structure is output to a PDF surface). Round-trip editing a lossy (from Inkscape's perspective) foreign vector file format (PDF) in an SVG editor is not guaranteed to produce similar, let alone identical results. PDF was designed as display format (identical output on different output devices), not as data exchange or easily editable image format. PDFs can include data not supported by Inkscape at all (e.g. OCR text in this case, as far as I can tell). And yes, Inkscape often does not a good job when being used to round-trip edit PDF documents (especially when masks are involved, as in this case for the visual representations of the OCR'd text).


http://www.inkscapeforum.com/viewtopic.php?f=5&t=19077&p=72719#p72719

and/or you are trying to embed a raster image of a specific format and colour profile.
http://www.inkscapeforum.com/viewtopic.php?f=29&t=19083#p72804

For saving as pdf-s, even embedded png-s with alpha channel can cause problems if you try to re-open and edit.


I may be misunderstanding you as there is a lot of jargon thrown around in here, but no not one of these pieces come from another PDF file that I am trying to edit. This is an svg I created from scratch myself. It uses jpegs but it does not use anything that came from a pdf, nor is it a pdf that I am trying to edit. I am just trying to save it as a pdf because that is what is required for my printing company. It does save fine as a png but he will not accept that format because he says it will result in subpar printing.

Thank you so much Lazur!

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: SVG to PDF images not showing correct & background color

Postby ~suv » Fri Jul 24, 2015 2:23 am

christinama wrote:2. I have 3 jpegs in the svg but for some reason only one of them appears shaded when saved as a pdf and you cannot read the image.

Could you attach the three JPEG images here? Maybe the third one was created and saved in Photoshop using a different colorspace (possibly CMYK) and thus could trigger a similar issue when exporting to PDF as discussed in this recent topic:

christinama
Posts: 6
Joined: Thu Jul 23, 2015 11:22 am

Re: SVG to PDF images not showing correct & background color

Postby christinama » Fri Jul 24, 2015 3:17 am

~suv wrote:
christinama wrote:2. I have 3 jpegs in the svg but for some reason only one of them appears shaded when saved as a pdf and you cannot read the image.

Could you attach the three JPEG images here? Maybe the third one was created and saved in Photoshop using a different colorspace (possibly CMYK) and thus could trigger a similar issue when exporting to PDF as discussed in this recent topic:


Yes I certainly can add the jpegs! The first two are the ones that show correctly, the last one is the one that shows up shaded was too big so I uploaded it to Dropbox and added the link below.
b. line logo.jpg
This logo show correct
b. line logo.jpg (49.63 KiB) Viewed 7190 times

Bloom_logo.jpg
Logo showing correct
Bloom_logo.jpg (117.02 KiB) Viewed 7190 times

https://www.dropbox.com/s/kkt31he2as3gm ... o.jpg?dl=0

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: SVG to PDF images not showing correct & background color

Postby ~suv » Fri Jul 24, 2015 4:16 am

As suspected, the JPEG image which exports with incorrect colors to PDF uses CMYK colorspace:

Code: Select all

$ for img in *.jpg; do echo -n "$img: "; identify -verbose "$img" | grep Colorspace; done
Black Tie Logo.jpg:   Colorspace: CMYK
Bloom_logo.jpg:   Colorspace: sRGB
b. line logo.jpg:   Colorspace: Gray
$

You could try to find (or convert to and save) a version of that bitmap image in an RGB-based colorspace - then export to PDF should match the colors closer to the original image.

--
christinama wrote:I am just trying to save it as a pdf because that is what is required for my printing company. It does save fine as a png but he will not accept that format because he says it will result in subpar printing.
Please note that Inkscape's PDF export does not support color-managed workflows (yet): the created PDF file will always be based on the RGB color model (colorspace sRGB - if I remember correctly).

christinama
Posts: 6
Joined: Thu Jul 23, 2015 11:22 am

Re: SVG to PDF images not showing correct & background color

Postby christinama » Fri Jul 24, 2015 4:52 am

Thank you so much Suv! I really appreciate it a lot! This stuff does not make the most sense to me but you are huge time saver to me! THANK YOU!


Return to “Help with using Inkscape”