l1xnan / obsidian-better-export-pdf

Obsidian PDF export enhancement plugin
MIT License
242 stars 13 forks source link

Bug: Images of the note are not always in the exported pdf-file #162

Open merlinuwe opened 3 months ago

merlinuwe commented 3 months ago

I try to print a note to pdf. In the preview of your plugin I see the embedded images. But not in the generated pdf file.

image

The places are empty:

image

CT23A LABV INF KA02 US 2023-12-06 Excel.pdf CT23A LABV INF KA02 US 2023-12-06 Excel.md

l1xnan commented 3 months ago

Strange bug. Is the official export feature working properly? Is minimizing a document (with only a short paragraph of text and an image) working properly?

merlinuwe commented 3 months ago

Making a pdf file with Obsidians pdf and your plugin is possible (when the note holds only these images and YAML) with typical image file types:

yaml, headers and images

muell.pdf

muell.md

yaml, headers, images and some text

muell2-images and some text.pdf

muell2 yaml, headers, images and text.md

I'll try to narrow down the cause of the error.


Export with native Obsidian pdf export works:

CT23A LABV INF KA02 US 2023-12-06 Excel.pdf

Export with your plugin is without images:

CT23A LABV INF KA02 US 2023-12-06 Excel betterExportPlugin.pdf

But: When I look at the windows 10 preview, I see (!) the images:

image

I work with Adobe Acrobat Reader

image

and Adobe Acrobat Pro 2020

image

after updating

image

Adobe does not show the images, but the windows 10 preview and your built in preview does.

Found it: This link (line 31) to an other note causes the problem:

The file had assigned a gender icon, which was the cause.

Is it possible to work around such problems in the plugin code?

l1xnan commented 3 months ago

There is a configuration in the plugin that may affect the compatibility of PDF generation. If you have it enabled, it is best to disable it. image

Other than that, I don't have any ideas on how to solve this problem. Would it be possible to package the icons from line 31 and a small amount of text images (create a reproducible example of the issue)? I can then debug locally to understand why this issue is occurring.

merlinuwe commented 3 months ago

I guess it's not possible to simply give you a file for testing, because a plugin assignes the icon. So I give you the informations to reprduce it on your PC.

This is the icon:

GenderBigender

I have installed the plugin "Iconize". You can get it from here or better install it from inside of obsidian.

https://github.com/FlorianWoelki/obsidian-iconize

This allows me to add an (this) icon to a file.

image

To have the choice, one has to additional install the package "tabler-icons" from the settings of iconize (Browse icon packs).

image

This icon lives in Obsidian\.obsidian\plugins\obsidian-icon-folder\icons\tabler-icons, if you use the default icon path .obsidian/plugins/obsidian-icon-folder/icons.

image

Then you can asign the GenderBigender icon to a note.

image

HTH