Enhancing Export plugin. For me it doesn’t work well actually
Incomplete: I wrote this script to convert Obsidian to Latex. It still needs a few improvements, but for simple cases it works. And yeah, it does maintain the internal links
+1 for a this feature request, I have a plethora of reasons to export .md docs to pdf and it’s a bit disappointing that none of my tables of content function when I do so. Any one have a work-around for now?
thx, for any help, or the feature implementation, if it’s possible…
Great big +1 from me! I’ve just wasted a day trying to write a Python script to fix internal links in Obsidian exported PDF files. PDF is such a cursed format
It’s a strange problem. Footnotes in the exported PDF work - along with the link by a footnote to take you back to the main text where the footnote marker is - but # links made by hand don’t. I wonder what’s happening during the export process that means footnote links work, but # links don’t?
Enhancing Export plugin. For me it doesn’t work well actually
Close to complete: I wrote this script to convert Obsidian to Latex. It still needs a few improvements, but for simple cases it works. And yeah, it does maintain the internal links, as well as the outline
would love to see this implemented in Obsidian, very useful feature, I’m surprised it’s been years since this was requested and not yet implemented. I totally understand the complexities of a roadmap and the prioritization of other requests by the developers.
I would love to see this as well but I fear it’s is not easy to implement, since obsidian seems to use the print function of the chromium browser it is built on and redirects the output into a pdf.
Currently pandoc with crossref seems the only option to generate a pdf with working links. Unfortunately pandoc doesn’t support obsidian wikilinks. But there is a plugin (I think it is called link converter) to convert obsidian links into standard markdown links that can be handled by pandoc.
There are two plugins as far as I know that integrate pandoc into obsidian. One of these is obsidian-enhancing-export. But its not easy to setup a working pandoc environment. In particular you need also e latex environment since pandoc cannot translate markdown directly to pdf but first convert it to latex which is then converted to pdf using pdflatex or xelatex.
I’ve been thinking about this, and I think I’ve worked out a possible solution, based on the fact that external (http://) links work.
Just before a PDF is exported, rewrite all in-document links to dummy external links, e.g a link to [[#Some heading]] gets rewritten to [Some heading](http://dummy.url/#Some%20heading)
I think it’d be possible to write an Obsidian plugin to do this, either by hooking up a notification to when PDFs get exported, or triggering PDF export from the plugin itself.
Based on my limited understanding of the PDF format, it might be quite hard to do 3), since I believe PDF internal links are based on actual locations in the document (e.g ‘a rectangle halfway down the page on page 23’) rather than named headers (eg ‘#Some heading’). Should be doable though, even if it’s just by searching through the document looking for the location of ‘Some heading’ in the correct style or something.
Anyway. My time for actual coding is very limited right now (I’m trying to finish a big writing project), but I might have a crack at it when that project is done.
Woohoo, got a proof of concept plugin working! It’s nowhere near ready to release yet, but all the parts that implement the solution I proposed are in place, and it kinda works mostly!
Posting here in case anyone else who can code Obsidian plugins would like to pick it up and refine it a bit further. I’m not going to have any time to work on it for a couple of weeks.
For clarity: this is not a plugin ready for everyday use. It’s code for developers only which proves that it’s possible
The Footnote when exported to pdf work amazingly just like what we need, sadly i cant choose the location for the foot note otherwise this would be solved
I would be very happy to even see the more simple solution that none of the internal links show up in the pdf as links. I share a lot of material from Obsidian and always copy paste it into another word processor before exporting a pdf from there. That way I don’t get the clunky links, that don’t work anyway. Sometimes I also just want to print it out and don’t want a lot of underlines in the page.
I think this feature should be available by default. Currently, it is not possible to seamlessly share your notes to none obsidian users. This issue being one of the main reasons why.
It is also disappointing to see, in my opinion, simple and necessary features not being implemented years after they are first discussed.