Internal/Reference Links don't work in PDF
I'm using Print Preview -> Save as PDF. External links are fine, but internal/reference links (something like #partii) are displayed but not clicking on them doesn't make PDF document go to that location.
I'm using following notation
[Part II](#partii)
## Part II {#partii}
or just
## Part II
because marked auto generates IDs for headers.
Is there anyway to make internal link work in PDF?
In Adobe Reader I get the following error when I click on internal links:
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 26 Nov, 2012 07:03 PM
It's a limitation of the webkit print system. I've long been looking for a way around it, but have nothing short of generating documents entirely outside of webkit (Pandoc, wkpdf), but then I can't maintain much of the formatting. It's a quandry.
2 Posted by Azat on 28 Nov, 2012 07:59 PM
Brett,
What would be the best, i.e., fastest and most accurate in terms of preserving formatting, way of converting markdown/HTML to PDF? Pandoc+Latex or something else?
Support Staff 3 Posted by Brett on 28 Nov, 2012 08:02 PM
Take a look at wkpdf and wkhtmltopdf. Combined with your preferred Markdown processor, they can do a pretty decent job, though I can't remember offhand if both deal with internal links the way you need. If I find a better solution, I'll definitely post it.
4 Posted by Azat on 28 Nov, 2012 08:11 PM
Maybe it's possible to include reference links in auto-generated TOC which Marked app already does using page numbers in PDF, e.g.,
<A HREF="http://www.example.com/myfile.pdf#page=4">
Would be nice to have this feature!
5 Posted by otto.hammersmit... on 11 Jan, 2013 02:49 AM
Same problem.
It wouldn't be an issue, except the "Save PDF" saves as a single page. Which can get giant if it's a long document.
If that could be paginated, that would be swell.
P.S. OpenID login is busted on the support site. And I think the captcha ate my comment the first time.
Support Staff 6 Posted by Brett on 11 Jan, 2013 03:04 AM
You can paginate by using Print -> Save as PDF. Internal links don't work in _any_ webkit pdf output at this point. It's something I'm hoping Apple will fix in the near future.
7 Posted by Ivan Wong on 09 Apr, 2013 02:37 AM
Has anyone any workaround to share to enable internal linking?
At the moment I'm resorting to inserting this in my css to make the output not appear to be a link, but nothing more frustrating that hovering and not being able to click in a pdf :)
@media print { /* print only styles. Keep it clean */ a { color: black; } }
8 Posted by Azat Mardanov on 09 Apr, 2013 02:43 AM
Hi Ivan,
I solved the problem by moving the Markdown -> PDF conversion away from Marked app to LeanPub platform. They use Latex and bunch of other stuff.
--
Azat Mardanov
azat.co (http://azat.co)
9 Posted by Ivan Wong on 09 Apr, 2013 03:48 AM
Hi Azat,
Thanks for the tip - am checking out their platform now and they apparently use markdown (vs multimarkdown) so some marked features don't seem to be available.
My markdown syntax for links also appears to be incorrect as it is not being converted.
Could you please share your syntax for links and images in LeanPub?
Thanks,
Ivan
10 Posted by Azat Mardanov on 09 Apr, 2013 04:13 AM
Google for leanpub manual.
11 Posted by Ivan Wong on 09 Apr, 2013 04:23 AM
Oops should have RTFM first...
Thanks again.
Brett closed this discussion on 25 Apr, 2013 08:48 PM.