public static void main(String args) throws IOException,
String inputFile = "C:/Documents and Settings/ADMIN/workspace/Html_to_PDF/WebContent/Converter1.xhtml";
String url = new File(inputFile).toURI().toURL().toString();
String outputFile = "C:/Documents and Settings/All Users/Desktop/Converted.pdf";
OutputStream os = new FileOutputStream(outputFile);
ITextRenderer renderer = new ITextRenderer();
I have use this example for creating PDF (example is available in internet) but textbox part doesn't appear. So, help me how to create the textbox in PDF for entering the data and also tell me how to save this PDF (I have use online passport application so i'm trying to built PDF as like passport application).
Deepak Naithani wrote:While displaying in browser it displays in proper format (Name: <textbox>)
Browsers will try to do something reasonable with malformed HTML. Presumably the product you're asking about doesn't do that, or maybe it doesn't do it in the way you expected.
I think you should follow Ulf's suggestion -- especially since your only requirement is to show a text box. Right now you're acting as if your requirement is to use exactly that HTML and nothing else, which it isn't.
Ok if i'll use the form tag i will require server side scripting for it (eg. jsp) it will work on browser. I want all this functionality in PDF. Like "Name label and textbox for name, Number label and textbox for number, etc".
I want to make a PDF like online passport application which is providing a PDF to get downloaded and at user side we can fill the form in PDF.
Please understand what i am trying to do i want to add textbox to PDF form. Is there any way i could do it.
Well, if you want that PDF-producing product to produce PDF from malformed HTML according to your specifications, you could certainly change it to do that. I am right in believing that it's open source, aren't I? If so, then you could fork it. But I think that might be a lot of work.
While I don't understand why you have to work with broken HTML, have you at least tried if it works with correct HTML? Knowing whether this is a limitation of FlyingSaucer in general, or whether it's simply due to the broken HTML, would be important in order to make decisions about how to proceed.