Adding page numbers to links in DITA PDFs generated with CSS?

daudvyd
Posts: 25
Joined: Sun Aug 05, 2018 5:15 am

Adding page numbers to links in DITA PDFs generated with CSS?

Post by daudvyd » Mon Oct 15, 2018 7:43 pm

If I want to created a printed book from a large DITA map with many links, is there a way to automatically add a page number behind every link so that readers can still follow the links? For example, if the links happen to be capitalized, instead of "see LINK", I want the output to read "see LINK (p. 212)". Is there a best practice to accomplish this?

Dan
Posts: 476
Joined: Mon Feb 03, 2003 10:56 am

Re: Adding page numbers to links in DITA PDFs generated with CSS?

Post by Dan » Tue Oct 16, 2018 10:39 am

When applying the DITA Map to PDF (WYSIWIG or HTML5 based) transformation scenario, (having Chemistry as CSS processor ) you should automatically get links with a "(on page NN)" text following them.

Are the links working (i.e. are clickable and navigate correctly)?
What oXygen version are you using?

For your information, the builtin CSS rules are the following:

Code: Select all


*[class ~= "topic/xref"][href]:after,
*[class ~= "topic/link"][href]:after {
content: " (page " target-counter(attr(href), page) ")";
}
You can use them in the customization CSS.

Many regards,
Dan

daudvyd
Posts: 25
Joined: Sun Aug 05, 2018 5:15 am

Re: Adding page numbers to links in DITA PDFs generated with CSS?

Post by daudvyd » Tue Oct 16, 2018 10:56 am

Dan, thank you for the CSS code. That is very helpful to modify the results.

Post Reply