Inkscape.org
Beginners' Questions Export to .pdf is missing a lot of objects
  1. #1
    WeaselTrap WeaselTrap @WeaselTrap

    Hello,

    For a project I need to create some .pdf´s from some files I have made, but the problem is that when I export them to pdf almost none of the objects are there.

    Some screenshots of what I mean:

    The inkscape file before exporting and what I want the result to look like: https://imgur.com/R4sXr9d    

    And what the pdf ends up looking like: https://imgur.com/DSbonOP

     

    As you can see it are simple shapes and nothing to fancy with gradients or the likes. 

    This problem is existing in all the files that I've tried. I looked into preparing the file for export as much as I could like converting the text to paths, but nothing seems to help.

    I also tried searching for discrepancies between the objects that did export and those that didn't but I could not really find anything, I compared the objects in the XML editor but there was nothing that caught my eye.

    I've tried all the options in the pdf export settings, but nothing seems to change anything.

    Searching online for a solution did not provide a result.

    The problem is not only existing when I export to .pdf but also when I export to .eps, but when I export the drawing as .png everything is fine.

    Anybody know some steps I might have missed in preparing the file for export, other things I missed or what the cause of this problem is?

     

    Here is an example .svg file if you want to take a look: https://1drv.ms/u/s!AnQjZIfKY6zjhsZkIrNMX___Lg395A?e=dliaeC

     

    My OS is Windows 10 Home, version 10.0.18363 and I used Inkscape-1.0-x64

     

  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    This may be a bug.

    Can you share a test file with a single object having a swatch color for the fill?

     

    Thanks.

  3. #3
    Tyler Durden Tyler Durden @TylerDurden

    It CAN work, btw.

    4Way Breakout Top
  4. #4
    WeaselTrap WeaselTrap @WeaselTrap

    First of all thanks for the taking a look at it.

    I've made a test export of a new file with one object and that comes out fine: https://imgur.com/a/sIip5H7

    I see you've got it to work, did you have adjust some things in order to get it to work or should I just try reinstalling my installation of Inkscape?

    I do however see that the lines in the exported pdf are somewhat thicker than the original, any ideas?

     

    Sincerely, WeaselTrap

  5. #5
    Tyler Durden Tyler Durden @TylerDurden
    *

    I will need the actual svg file containing a swatch. 

    Thanks.

    Some pdf readers like Adobe will make lines appear heavier depending on zoom. (renders lines at 1px)

  6. #6
    WeaselTrap WeaselTrap @WeaselTrap

    Ah oké, here you go: https://1drv.ms/u/s!AnQjZIfKY6zjhscSWKFWB08WUnppkA?e=Qr6s7w

     

    Thanks for the info

  7. #7
    Tyler Durden Tyler Durden @TylerDurden

    Well, my bug theory is bust. But, I can tell you what's wrong with the breakout file:

    Swatches are special one-stop gradients stored in the non-visible section of the svg file called the "defs".

    The test2.svg file has a single swatch. The swatch looks like this in the defs:

      <defs
         id="defs833">
        <linearGradient
           osb:paint="solid"
           id="linearGradient833">
          <stop
             id="stop831"
             offset="0"
             style="stop-color:#ff5555;stop-opacity:1;" />
        </linearGradient>
        <linearGradient
           gradientUnits="userSpaceOnUse"
           y2="87.312496"
           x2="212.42262"
           y1="87.312496"
           x1="76.351196"
           id="linearGradient835"
           xlink:href="#linearGradient833"
           inkscape:collect="always" />
      </defs>

    Here is the swatch in the breakout box file (after cleaning* the document):

       <linearGradient
           id="linearGradient861"
           osb:paint="solid"
           gradientTransform="matrix(0,0,0,0,6474.824,97.9605)">
          <stop
             style="stop-color:#619913;stop-opacity:1;"
             offset="0"
             id="stop859" />

    So, we can see there is a fair bit missing from the code for the gradient, like half.

    If we insert the missing code into the document with a text editor, the objects carry over into the pdf.

    I'm guessing the file was not originally from Inkscape, or it got saved as a pdf then got brought back into Inkscape. For whatever reason, the code is missing and trips-up the conversion process to pdf.

     

    * File> Clean up document  a.k.a. "Vacuum Defs"

  8. #8
    Aero Aero @Aero◻️
    *

    The test2.svg file converts to PDF just fine here. 

    As far as I can see, the gradientTransform of type matrix is the issue here.

    Deleting this code in line 36 and 129 in OP's original file (4way Breakout top.svg) makes this file also convert to PDF just fine here.

  9. #9
    WeaselTrap WeaselTrap @WeaselTrap

    The file was originally created in Inkscape, but later had a .dxf imported in it so that has maybe caused it.

    @Aero, thanks this is the solution to my problem, after deleting those lines from all the files they've exported without a problem! So thanks to both of you for your help.

     

  10. #10
    Vladi Vladi @Vladi

    Hello, I´ve got a similar problem with exporting from an SVG file. 

    Can you please PM me or contact via e-mail, I´ll share the whole file with you?

    Thanks!

  11. #11
    Vladi Vladi @Vladi

    Hi again, I created a small version of my file deleting most content (the full file is 12 MB) but it still won´t work: 

    https://drive.google.com/file/d/1E_f5a10VeHxZ15oBIHIN2j7eIjggq_tu/view?usp=sharing

    It seems that the problem concerns some designs I copied from a file created in some older version of Inkscape 2 years ago.

    Can you please help? Thanks!

  12. #12
    Vladi Vladi @Vladi

    I tried deleting the "<linearGradient..." section in XML as I don´t use any gradients in my design. As a result, some objects lost their fill but I could change that manually. The pdf then exported ok, I´m just not sure if my action had no unwanted consequences that I haven´t noticed...

  13. #13
    Vladi Vladi @Vladi

    Tried a better method now, changed the colour in "<linearGradient..." section in XML to #ff00ff, that helped me to indetify most objects in question and remove the unwanted gradient from them. Still there are few more remaining. Is there an easy way how to relate an object highlighted in the Inkscape XML Editor view to the "real" object in the working space? Doing it visually would of course be ideal.

  14. #14
    Tyler Durden Tyler Durden @TylerDurden

    Typically, the objects selected in the xml are indicated in the workspace by the bounding box. 

    Inkscape also has tool like search, to find objects with specific attributes.

  15. #15
    Vladi Vladi @Vladi

    Thanks a lot for coming back to me!

    TylerDurden

    Typically, the objects selected in the xml are indicated in the workspace by the bounding box. 

    That´s what I´d have expected but it does not happen in this case.

    Tried searching for "linearGradient" (Value ID search enabled), found one object and amended it. Still there are some 9 "svg:linearGradient id" in the XML related to objects I can´t find.

  16. #16
    Tyler Durden Tyler Durden @TylerDurden

    I'd clean the document to see if those gradients are in use. If that fails, I'd try a text editor search to see if those gradients are in use.

  17. #17
    Vladi Vladi @Vladi

    How would I clean the document?

  18. #18
    Tyler Durden Tyler Durden @TylerDurden
    TylerDurden

    * File> Clean up document  a.k.a. "Vacuum Defs"

    http://tavmjong.free.fr/INKSCAPE/MANUAL/html/File-Vacuum.html

  19. #19
    Vladi Vladi @Vladi

    I see, thanks! It helped with some, but not all of them. Out of those remaining, most had no further occurence in the XML. 6 had occurences, I found 3 using the Search function but the rest can´t be found :(

  20. #20
    Tyler Durden Tyler Durden @TylerDurden

    Is this a different file? When I clean the file that is shared above, only one swatch remains, eight were removed.

  21. #21
    Vladi Vladi @Vladi

    Yes, I´m working on the full file, not on the sample. I just don´t want to share it publicly. Is there a way to send private messages? Or email?

  22. #22
    Tyler Durden Tyler Durden @TylerDurden

    You can click on my avatar to see my profile where there is an envelope button to send a DM. I'll reply back with my email addy, but check that you have email notifications enabled (those may land in your spam).

  23. #23
    Vladi Vladi @Vladi

    Sent, thanks!

  24. #24
    Y.H.S Y.H.S @Y.H.S

    Hi,

    I have a similar issue. 

    Unfortunately, I don't understand the programming language you guys were using, so I couldn't really understand how you solved.

    Hope you can help me out somehow.

    Thank you.

    Hemerit'S Ankh Visitkort Forside
  25. #25
    Tyler Durden Tyler Durden @TylerDurden
    *

    @YHS, please describe your issue in detail.

  26. #26
    Y.H.S Y.H.S @Y.H.S

    Okay

    I hope you can see it on the attached files, that I am making a business-card on Inkscape, Underneath the part that says "Hemerit's Ankh" (in golden writing) there is written "Event & Food" (in silver). However, when I try to save a pdf copy, only halve of the silver writing is shown. 

     

     

  27. #27
    Tyler Durden Tyler Durden @TylerDurden

    The pdf looks ok here in adobe reader...

  28. #28
    Y.H.S Y.H.S @Y.H.S

    Thats so weird

    Is it perhaps because I am using Mac? 

     

    Screen Shot 2021 10 17 At 19.46.17
  29. #29
    Tyler Durden Tyler Durden @TylerDurden
    *

    It is likely your pdf reader does not manage the mesh gradient. I would try uploading to your print-house and see if the preview is also a problem.

    I like the mesh gradient, but you could fallback to linear gradient with multiple stops.

  30. #30
    Y.H.S Y.H.S @Y.H.S

    Hi Tyler,

    Thank you for the advice. I got the problem solved. 

  31. #31
    HyBrYdE HyBrYdE @HyBrYdE

    Hello,

    I know that this post is quiet old but i have obtaine a similar issue during my use of Inkscape 0.92.

    I had a lot of object (simple shape or text) that was missing after exporting in pdf format and even with a direct printing from Inkscape.

    I have solved this issue by changing from "?" (unknown background) in the setup "font" from "background and outline" to "flat". And then i was able to export correctly the object that wasn't appeared precendtly. For the text, it's the same solution but in the setup "outline"

     

    Hope that will help someone and that i had explain correctly my process.

     
Inkscape Inkscape.org Inkscape Forum Beginners' Questions Export to .pdf is missing a lot of objects