mgufrone / pdf-to-html

PDF to HTML PHP Class using Poppler-Utils
MIT License
176 stars 89 forks source link

Formatting & Rendering issue #20

Closed JfrankMainframere closed 8 years ago

JfrankMainframere commented 8 years ago

I can't believe how amazing this library is! I am just having some rendering issues mainly checkbox form fields and the length of the underscores. Is there any way to change the rendering so that it will show an HTML checkbox rather than nothing? How can I go about customizing the replacement of PDF elements (Text areas, Text input, radio buttons)?

mgufrone commented 8 years ago

This one is particularly difficult within this package. The pdftohtml binary unfortunately can't render form controls such as text areas, text inputs, radio buttons, etc. I will keep in mind of your suggestion.

JfrankMainframere commented 8 years ago

Well it renders "■" when the checkbox is checked, but nothing when it is blank. Is there anyway to at least make it render something for an empty checkbox as well?

JfrankMainframere commented 8 years ago

Or if you have any other suggestions for how to load a PDF edit it in with a custom GUI on the webpage and resave the html as pdf? I have both ends of this system in place but cant move much further without all of the form fields at least loading as visible characters to be replaced.

mgufrone commented 8 years ago

That sounds promising. I think I need a pdf complete with form controls. Checkboxes, radio buttons, text inputs, and other form controls. So i can parse it to the correct form controls. Do you have that kind of pdf?

JfrankMainframere commented 8 years ago

demoform1.pdf

mgufrone commented 8 years ago

Okay, I will let you know regarding the update. 👍

JfrankMainframere commented 8 years ago

If you could also point me in the direction of the parsing class or anything like that I would be more than happy to contribute to this library and figure out the form controls etc if I am able to.

mgufrone commented 8 years ago

this code is responsible to handle the HTML thing. https://github.com/mgufrone/pdf-to-html/blob/master/src/Html.php

rhoyle commented 8 years ago

First of all let me say thank you for the work you have done. This is my problem I am trying to create a back end for a website that will allow the user to input their certificates for classes they have completed. Most of the certificates are in pdf format and in less you use Adobe reader or some other pdf reader you can’t view the file and even if you use, let’s say adobe; the pdf pups up in a separate window. Using an iframe has its share of problems as well; that’s why I thought that using you pdf to html would do the trick. Well the first problem is how to get it to setup in Laravel 5.3, I used composer to install it; and I put the poppler-0.47 file in my windows program files (x86) directory, but I am not shore where to insert the code you pervade us on the page. I am somewhat of a new be to Laravel and am not shore, please help if you can I am using Laravel 5.3.

JfrankMainframere commented 8 years ago

@mgufrone Hey man! I figured out a completely different solution, so I went ahead and closed this issue for the sake of your wonder project's appearance.

If you were curious what I did, or anyone Googling here was my solution was using PDF.js and overlaying input elements implementing this library.

NOTE: (The base changes all occur in core\annotation.js and display\forms.js. Rendering is still entirely done through pdf.js, except form widgets are no longer rendered graphically by pdf.js. Instead, a second layer with web form elements is rendered over the canvas.)

This is working seamlessly for me. I additionally implemented a drag and drop (HTML5 native) and resizing (jQuery Resizable)