Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a PDF responsive [closed]

Tags:

pdf

I have a pdf file that I want to make responsive so as to view it in desktops as well as mobiles. Responsive in the sense that it should not only fit the page based on the device size, but also the content i.e. text, images inside the pdf should also be responsive when viewing on a mobile. Just like the image shown below, pdf content should be aligned based on the device. Is there any API or library to achieve this.

Thanks in advance. Please help me to achieve this.

like image 996
Akshea Avatar asked Jul 02 '14 09:07

Akshea


People also ask

Can you make PDFs responsive?

By clicking the Liquid Mode icon, Adobe Acrobat uses Adobe Sensei to analyze the content of the PDF and reflow it into a mobile responsive reading experience. Everyone has slightly different reading preferences to make reading comfortable for them on a phone like line-height, font size, etc.

How do I force a PDF to open at a specific page?

Open a PDF file to a specific page To target an HTML link to a specific page in a PDF file, add #page=[page number] to the end of the link's URL. Note: If you use UNC server locations (\\servername\folder) in a link, set the link to open to a set destination using the procedure in the following section.


2 Answers

As indicated by other answers, PDFs primary function was to be a visual representation of content and visual representation should typically be identical across different platforms / readers / devices. That was the goal of the file format and it's diametrically opposed to file formats such as XML that are all about structure.

However, in recent years PDF did get additional functionality that may help with this. PDF files now support tagging and the purpose of tagging is to add structure to the file. A PDF file that is properly tagged does know where paragraphs of text are, what are headers, what are lists etc... And that information in theory can be used to support (limited) responsiveness.

For example, see the link here (https://helpx.adobe.com/acrobat/using/reading-pdfs-reflow-accessibility-features.html) where Adobe explains how the reflow view in Acrobat Pro works. It states that Acrobat can use the tagging structure inside a PDF file (or even automatically create some semblance of tagging on the fly for documents that are not tagged) to give you a view of the PDF file adjusts itself to the available display size.

Whether or not this is going to work depends mostly on the reader technology you will be using on your mobile device and you should certainly not confuse the possibilities of this with full responsiveness where content is hidden, replaced, adjusted, repositioned etc... such as what you can accomplish with HTML and CSS on web sites.

But it is a start.

like image 144
David van Driessche Avatar answered Oct 19 '22 16:10

David van Driessche


It cannot be done. PDF is a final layout. Unlike the web page, where you are never sure what you're getting, the whole purpose of a PDF is to look the same no matter what device, or even medium, you're accessing it from. It basically says, "there will be the phrase 'Hello, World' in this font, this point size, at these x and y coordinates". You might as well try to reflow a hardcover book to fit into your pocket better.

like image 45
Amadan Avatar answered Oct 19 '22 16:10

Amadan