Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

PDF Page Number


Go to End


1362 Views

Avatar
DrWebGuy

Community Member, 16 Posts

5 March 2011 at 6:52am

I have an interesting problem that I need help with. A client wants to be able to easily specify in a link which page of the PDF the browser goes to. Adobe has built this function in to 6.0 and later - simply append "#page=13" to your link as an anchor. How could I modify the link section of the TinyMCE insert link function to give me a simple text field to enter "13" (if I want page 13) and have it append the anchor? I have looked at sapphire/forms/HtmlEditorField.php, and I feel like a new TextField could be added like "HtmlEditorField.PDFPAGE" and then have the editor append the appropriate code to the URL. It would be REALLY nice to make it work like the "Anchor on this page" field, but instead of a dropdown box appearing, a text field would appear to input a page number.

It's pretty simple concept - just hard to explain.

Thoughts anyone?