https://www.dendron.so/ logo
#questions
Title
# questions
s

seadude

02/05/2022, 4:21 PM
I need someone to verify an issue with PDF export and Images within HTML tables. Problem - Does your system render the Images when exported to PDF? - Mine does not; I need to determine if its just my system or if this is a bug **Setup**: 1. Create a new file in Dendron (
test.md
) 2. Ensure you have an
assets/images
folder in your vault 3. Add one image (.png) to the
assets/images
folder 4. Add the following HTML table to
test.md
(substituting
<image file name>
accordingly
Copy code
<table>
    <tr>
        <td style="border: 5px solid black; border-collapse: collapse; padding:0px; border-color: #27ad74;"> 
            <img src=".\assets\images\<image file name>"/> 
        </td>
    <tr>
</table>
5. Preview the file (
CTRL+SHFT+v
) ensure the image is rendered 6. Export the file as PDF (
Right click on the preview / Chrome (Puppeteer) / PDF
)
k

kevins8

02/05/2022, 4:42 PM
this is probably how links are traversed.in the resulting pdf. does the pdf have a link associated with it (even if its broken)? what does it link to? can you verify the following: 1. do images work if you use an absolute url to the image? (eg. C:\\foo\bar\) 2. do images work if you use an absolute web url? (eg.

https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/logo-256.png

)
s

seadude

02/05/2022, 4:46 PM
Checking now...
*RE: #1: * - Absolute URLS only work in Preview - The exported PDF remains blank RE: #2: - Web URLS only work in Preview - The exported PDF remain blank
(PDF has no body except the table. The only link for this test is an image in
assets/images
directory in my vault)
k

kevins8

02/05/2022, 5:03 PM
got it. and are you using markdown preview enhanced to do pdf export? how does it compare it you use pandoc from the command line?
s

seadude

02/05/2022, 5:09 PM
Looks like I have both Dendron Markdown Preview Enhanced and the original MPE extensions installed. Will check
pandoc cli
now...
Hm... running this command from `vault/`:
pandoc .\dendron.test.md -o dendron-test.pdf
resulted in the same unrendered PDF
I'd like to know if you/anyone else is seeing this behavior or if its isolated to my system
I have a hunch that installing a "complete TeX system" (MiKTeX) is somehow the culprit.
k

kevins8

02/05/2022, 6:03 PM
hmm, so i tested this out on my side with pandoc
the following both work
Copy code
## Image by absolute Url
![image by url](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/logo-256.png)

## Image by relative url without forward slash
![image in assets](assets/images/2022-02-05-10-01-10.png)
note that the relative link format is different from the default, needed to get rid of the forward slash
s

seadude

02/05/2022, 6:17 PM
Could you try embedding the image in the HTML table?
Even with leaving off the leading
./
from the Image link (
assets/images/filename.png
), the PDF still does not render on my end
Tried forward/backslashes between directories, same result Though its slightly concerning that ALL of the following render the image in Preview, stored in `vault/images/`: - Relative image links with and without`./` (thats weird to me) - Slashes in the image links going bothways! (backslash or forward slash)
k

kevins8

02/05/2022, 6:34 PM
Looks like its a known limitation with pandoc, see https://tex.stackexchange.com/questions/253262/pandoc-markdown-to-pdf-doesnt-show-images/253316 In order to get it to work, you'll need to use md inside of html like below ![test](assets/images/2022-02-05-10-01-10.png)
s

seadude

02/05/2022, 6:49 PM
Are you able to get that syntax to render in Preview?
I see that Dendron is "seeing" down to the
vault/assets/images/
directory. I can see the correct filename. But when viewing in Preview...nothing. Same than with Chrome/PDF. I'll try with pandac
Well...thats good(?) Using the "Markdown-image-link-sandwitched-by-HTML-table" kind of worked. - It does not show up in Preview - The image does render though minus all the table styling
Looks like there are `link_attributes`(inline CSS?) that can be appied to the image. Hm...
Wahoo!
My 1/2 day thesis on images... -
.
is the Markdown PDF export -
-
is the
pandoc
export
k

kevins8

02/06/2022, 4:42 PM
i think most pdf conversion tools use pandoc under the hood 😅