Lines in images are missing in exported PDF

This is how a linked pdf image is displayed in a slide in TeXmacs:


This is how it’s displayed in the exported PDF file:
image
The lines are missing but the letters and arrows are kept. This is very weird because the image is not drawn in TeXmacs but obtain from the ipe draw app. How can TeXmacs identify the lines in the first place?

The pdf image displays fine if I copy it to another TeXmacs document and export it.

Hello, this could perhaps be caused by some weird conversion bug. Try to fiddle with the “Edit -> Preferences -> Convert -> Image” options. There is a checkbox that forces conversion through Inkscape, maybe that is causing this error. Not sure.

The option is grayed out. And it’s for svg format.


However, I found another option here

Untick the first option and I can print the current page and the image is displayed correctly. However, in this case if I export the file to PDF, I only get the first 2 or 3 slides, not the whole document.

So, it looks like the embedded hummus pdf renderer has problems with that particular image.
I imagine you also tried playing with the other options (distill, or changing pdf version), with no success… In that case, can you please share the document or the image that we can look into it (or file a new bug report, attaching what is necessary to reproduce the bug)?

Finally I find this problem only occurs in that document, and can’t reproduce it in a new document. I issued a new bug report with the file attached.

1 Like

@pjoyez find the solutions and replied in the bug report: enable Distill encapsulated Pdf files or disable Produce Pdf using native export filter. So by doing this we essentially use gs instead of hummus for processing pdf files. But if I disable Produce Pdf using native export filter, then sometimes I get empty blank documents. So enabling Distill encapsulated Pdf files may be the best option. Is there any side effects of distilling pdf files?

To be more complete, it seems that specific image does not properly set the lines’ color before painting them. As a result, in the reported bug they end up painted white, the color of the slide title preceding the image.

The “Distill encapsulated Pdf files” preference actually corresponds to preprocessing each image with gs:

gs -dNOPAUSE -dBATCH -dQUIET -dSAFER -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -dEmbedAllFonts=true -dCompatibilityLevel=<from preferences> -sOutputFile=<temp distilled file> <pdf image>

In principle the only down side of running this command should be the delay needed for it to complete (unless you hit a gs bug, or the image itself has a problem that gs cannot handle). For avoiding unnecessary extra delay, one can also manually run this command only in case of a problematic image.

For the image in the report, the above command fixes the color problem and results in a significantly smaller file (but the size could increase if fonts need to be included).

Just reproduce the bug using https://github.com/XmacsLabs/mogan/releases/tag/v1.2.0-beta31

Let me fix it in Mogan v1.2.0-beta34.