Pdf rendering on ala google documents web pages

In the current project, I need to display PDF files on a web page. Right now we are embedding them in Adobe PDF Reader, but I would prefer something more elegant (the reader does not integrate well, it cannot be superimposed with transparent areas, ...).

I foresee something covering Google documents where they display PDF files as an image, but also allow me to select and copy text from PDF (the requirement we require).

Does anyone know how they do this? Or any library that we could use to get a comparable result?

I know that we could split the PDF files into server-side images, but that would not allow us to select the text ...

Thank you in advance for your help.

PS: Java based project using wickets.

+3
source share
1 answer

I have some suggestions, but it will be definitely difficult to implement. Good luck

First approach:

First use a library like pdf-renderer ( https://pdf-renderer.dev.java.net/ ) to convert the PDF to an image. Store these images on your server or use the caching technique. Converting PDF to image is not difficult.

Type Select JavaScript (http://www.typeselect.org/), . , . , . , . .

, .

:

PDF . Type-3 Type-1, () ( , Unicode, ). PDF- (.. ), , (), .

PDF, , ( PDF ) , HTML. HTML (, <H1> <p>, <b> <i>) ( ) ( , , , ) .
PDF- PDF, HTML-. PDF.

. PDF-, Adobe Font. , , ( Adobe Reader, ).

:

, .

(OCR), , . Google. , .

; Type Select PDF , OCR , , , (, = , lol) .

+2

Source: https://habr.com/ru/post/1735642/


All Articles