Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
6

XHTML to PDF: internal links raise security warning

Community Beginner ,
Jun 16, 2023 Jun 16, 2023

I am trying to convert an XHTML/CSS file to PDF. I would have thought that an easy thing to do, but i guess nothing is easy. Acrobat does not seem able to open an XHTML file, as near as I can tell. I can open it in a browser and then print it to a pdf, but when I do, all of the internal links (i.e. links to anchors in the XHTML) raise a security warning saying that it can't find the file and giving the file URL. (Again, these are entirely INTERNAL links.)

 

Aside from this issue, conversion to pdf by printing from the browser works fine. How can I fix this bizarre problem?

TOPICS
Create PDFs , General troubleshooting , PDF , Print and prepress
886
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 17, 2023 Jun 17, 2023

Are the internal links HREF=".... URL of file ... #anchor" or just HREF="#anchor"?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 17, 2023 Jun 17, 2023

They are the latter: #anchor. They have to be, because this file is a manual that will get distributed, so there is no way to know what the full URL will be. Or is there?

 

I discovered that I could go through each and every internal link, delete it as a URL, add a Destination, then add a link to it. If I have no other choice, I guess I have to do that, but it sure seem a pretty bare-knuckles way to go about things.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 17, 2023 Jun 17, 2023
LATEST

I think I fixed it, and it is one of the strangest bugs I have ever seen.

I realized that some of the Table of Contents links were working and others were not. Hovering over the TOC links in the PDF, I found that a number of the TOC links were missing the hashtag (#). I opened an older version of the XHTML document from about four days ago, and all of the links had hashtags and all worked, but when I looked at the current version, those hashtags were missing. Now, I've done nothing to change the TOC for at least a couple of weeks, so I'm not sure how only some of those hashtags disappeared, but that's not even the weirdest part.

When I fixed the links in the TOC and added the hashtags back, all of the other internal links (which had the hashtags but weren't working) suddenly started working. All that I can figure is that the missing hashtags invalidated relative links in the XHTML, breaking all of the internal links, which, of course, were relative, as opposed to the external links, which were absolute. I dunno, doesn't really sound logical, but I'm not sure how else to explain it.

I need to work with the document a little more to feel certain, but I just clicked through the entire TOC and then walked through the document and clicked internal links as I found them and everything seems to be working.

Whoa!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines