allcolor / YaHP-Converter

YaHP is a Java library that allows you to convert an HTML document into a PDF document.
GNU Lesser General Public License v2.1
56 stars 23 forks source link

PDF generation issue when html contains form fields #47

Open rupalirhatol opened 8 years ago

rupalirhatol commented 8 years ago

Hi,

The PDF being generated has form fields like first name , last name but the value of form fields overflows the text box border. I am trying to convert PDF for below string which has HTML form field and PDF generated is attached. It does not look good sample.pdf java codepng

String str2 = " "+ "

"+
"Student: "
+"
" +"
" +"" +" "; converter.convertToPdf(str2, IHtmlToPdfTransformer.A4L,
headerFooterList,
null,
out9, properties); sample9.pdf

allcolor commented 8 years ago

Hi, set the size via stylesheet and specify the unit, or simply replace the input field by a span with a style that specify a border.

like: value

Regards, Quentin

Le 9 nov. 2016 12:54 AM, "rupalirhatol" notifications@github.com a écrit :

Hi,

The PDF being generated has form fields like first name , last name but the value of form fields overflows the text box border. I am trying to convert PDF for below string which has HTML form field and PDF generated is attached. It does not look good sample.pdf https://github.com/allcolor/YaHP-Converter/files/579624/sample.pdf [image: java codepng] https://cloud.githubusercontent.com/assets/23347875/20122306/a3e0aab8-a5cb-11e6-8d94-d1141a93ae29.png

String str2 = " "+ "

"+ "Student: " +" " +"
" +"" +" "; converter.convertToPdf(str2, IHtmlToPdfTransformer.A4L, headerFooterList, null, out9, properties); sample9.pdf https://github.com/allcolor/YaHP-Converter/files/579619/sample9.pdf

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/allcolor/YaHP-Converter/issues/47, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJ5B_mw6dMCWVaqDBeugKQSxBCGAEqaks5q8Qu-gaJpZM4KtDNZ .

rupalirhatol commented 8 years ago

Ok thanks for the solution. It helps but the HTML source code is we are getting is from third party where they are not ready to modify it or neither we are allowed to alter anything in their source html due to security reasons. Is there any other option? Thanks again and Appreciate your quick response.

allcolor commented 8 years ago

Hi, i've no other solution. If you can't modify the html at the source, then simply preprocess it and replace all text input field by a span with a border before giving it to the converter.

Regards, Quentin

Le 11 nov. 2016 12:39 AM, "rupalirhatol" notifications@github.com a écrit :

Ok thanks for the solution. It helps but the HTML source code is we are getting is from third party where they are not ready to modify it or neither we are allowed to alter anything in their source html due to security reasons. Is there any other option? Thanks again and Appreciate your quick response.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/allcolor/YaHP-Converter/issues/47#issuecomment-259840410, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJ5B9Y0mqzx214SGJhRj6NRnmJTwoqtks5q86r7gaJpZM4KtDNZ .