Author Topic: Exporting PDF to SVG - most of the graphics is lost  (Read 1027 times)

October 24, 2018, 03:47:49 AM
Read 1027 times

sau

  • Sr. Newbie

  • Offline
  • **

  • 5
Hi All,
I have been exploring the PDF to SVG export feature of Inkscape. Looks generally good. Except for one PDF where most of the colours were missing in the exported SVG.  I have attached the sample PDF and also the screen shot. I am using Inkscape 92.3

Any suggestions?

Thanks,
Sau

  • Inkscape 0.92.3 (2405546, 2018-03-11)
  • Windows 10

October 24, 2018, 04:12:22 AM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

It looks like quite a bit more than just colors is missing.

When you open the PDF in Inkscape, Inkscape gives you a little dialog with several options there.  2 of the options are about what to use to import the contents.  So first you could experiment with which import method works best.

If you can't get a correct result from any combination of options, we can examine the file.  It might be that there are some contents which Inkscape can't handle properly.

Let us know if switching the import options helps.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 24, 2018, 04:41:17 AM
Reply #2

sau

  • Sr. Newbie

  • Offline
  • **

  • 5
Thanks for the quick reply.  As per your suggestion, I tried using the "Poppler" option in the popup dialog at the time of importing the PDF and you are right. The reproduction is much better.    However, there is an unintended consequence. When I save it to a SVG file, all the text is converted to vector graphics.   My objective was to get hold of the vector graphics from the PDF and leave the text as text.  The default import options of Inkscape does this very well. 

Thanks,
Sau

  • Inkscape 0.92.3 (2405546, 2018-03-11)
  • Windows 10

October 24, 2018, 05:38:07 AM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Hhm, when I open the PDF in Inkscape, I find all the text is identified as Symbols.  I don't know why that happens.  Maybe someone else knows.  Or if you don't get any other answers, we can contact developers and ask.

I don't know if that means the text was already as Symbols in the PDF, or if Inkscape makes them into Symbols.  However, if you saved as SVG, the SVG should be saving Symbols.

What do you mean when you say the text is converted to vector graphics?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 29, 2018, 08:05:26 AM
Reply #4

sau

  • Sr. Newbie

  • Offline
  • **

  • 5
Hi ,
Sorry, my initial post was not so clear.
Exporting to SVG without the POPPLER option
Many of the colors are lost.
All the text from the PDF is exported as readable text in the SVG.
I can see the text as plain English when I open the SVG file in notepad. These are all <text> elements


Exporting to SVG with the POPPLER option
Colors are preserved.
The text is no longer readable when I view the  SVG file in notepad.
The text is converted to something else. I do not see any <text> elements.

Preserving the TEXT elements is important in my scenario.  I have attached the 2 SVG files.

Thanks,
Sau


  • Inkscape 0.92.3 (2405546, 2018-03-11)
  • Windows 10

October 29, 2018, 09:10:18 AM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I don't know.  Maybe someone else can suggest another alternative for you - maybe another program can do what you want?

The only thing I can suggest as far as using Inkscape, is to use the option which preserves the text, and then in Inkscape, replace the colors.

Ooohhh!  Looking more closely than I did originally, I see that the colors aren't actually lost.  It's just that the paths have become very, very thin, and they look gray.  But once you zoom in, you can see the colors.  You can easily make the paths wider by adding a stroke, and then adjust the stroke wider.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 29, 2018, 01:52:41 PM
Reply #6

sau

  • Sr. Newbie

  • Offline
  • **

  • 5
Thanks for looking into this.  Doing a manual alteration might work for a couple of documents. But, we need a more industrial solution.

I hope Inkscape developers would be kind enough to take a look and possibly roll out a fix.

thank you.
  • Inkscape 0.92.3 (2405546, 2018-03-11)
  • Windows 10

October 29, 2018, 02:22:22 PM
Reply #7

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
If you need that, you might want to report a bug first. Else, nobody will know about the issue.
https://inkscape.org/en/contribute/report-bugs/

October 29, 2018, 02:45:41 PM
Reply #8

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
But what's the bug?  The PDF import dialog indicates that the text will be converted to glyphs, using the Poppler/Cairo import.  So is the bug the part where the colored paths are made very thin, with the internal import?  For some reason, I thought that was known, although I could be wrong.

Edit
In any case, if you'd like to have a discussion with developers, rather than directly reporting a bug, you can do that most easily using IRC.  Mailing list is probably the best way, although understandable if you don't want to subscribe just to discuss one issue.  Info on both:  https://inkscape.org/community/  Although reporting a bug is totally fine  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 30, 2018, 03:01:47 AM
Reply #9

sau

  • Sr. Newbie

  • Offline
  • **

  • 5
Logged a bug.
https://bugs.launchpad.net/inkscape/+bug/1800621

My reasoning for opening a bug is that the behaviour of the product (export PDF to SVG) has to be consistent across all PDFs. Unless I have missed something.

Thanks all for your support.
  • Inkscape 0.92.3 (2405546, 2018-03-11)
  • Windows 10

October 31, 2018, 06:46:28 AM
Reply #10

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann