How to make PDF responsive

I have a pdf file that I want to make responsive in order to view it on both desktops and mobile phones. Responsive in the sense that it should not only fit the page based on the size of the device, but also the content, that is, the text, the images inside the PDF should also respond when viewed on a mobile device. 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 achieve this.

+8
pdf
source share
2 answers

It's impossible. PDF is the final layout. Unlike a web page where you are never sure what you get, the whole purpose of a PDF file is the same, no matter what device or even medium you get from it. Basically he says: β€œIn these fonts, this dot size, in these x and y coordinates will be the phraseβ€œ Hello, World. ”You might as well try to pay a hardback book to fit better into your pocket.

+7
source share

As indicated in other answers, the main function of the PDF files was to be a visual representation of the content, and the visual representation should usually be identical for different platforms / readers / devices. This was the purpose of the file format, and it is diametrically opposed to file formats, such as XML, which are structured.

However, in recent years, additional functionality has appeared in PDF format that can 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 correctly tagged knows where the paragraphs of text, headings, lists, etc. are located. And this information in theory can be used to support a (limited) reaction.

For example, see the link here ( https://helpx.adobe.com/acrobat/using/reading-pdfs-reflow-accessibility-features.html ), where Adobe explains how the reflex works in Acrobat Pro. It states that Acrobat can use the tag structure inside the PDF file (or even automatically create some similarities with the tags on the fly for documents that are not tagged) to give you an idea of ​​the PDF file, adjusting to the available screen size.

Regardless of whether it works, it mainly depends on the reading technology that you will use on your mobile device, and you certainly should not confuse the possibilities of this with full responsiveness when the content is hidden, replaced, adjusted, changed and etc ... for example, what you can do with HTML and CSS on websites.

But this is the beginning.

+7
source share

All Articles