PDFBox can't convert other formats to PDF. I've had success using PhantomJS in 
the past, so you might want to try that. Alternatively, if you're generating 
the HTML from XML then you could try generating FO instead and use Apache FOP 
to generate your PDFs.

-- John

> On 17 Dec 2014, at 20:08, Amanda Burma <ama...@froglogic.com> wrote:
> 
>> On 12/17/14, 12:55 PM, Ken Bowen wrote:
>> Amanda,
>> 
>> Depending on your needs, most browsers have a “Save as PDF” facility.  If 
>> all you need is a series of one-off conversions, that might work well for 
>> you.
> I'm looking for a command line utility that i can incorporate in a script. 
> I'm converting the XML to HTML, and was interested in a way to convert it to 
> PDF.
> 
> Amanda
>> Ken
>> 
>>> On Dec 17, 2014, at 12:45 PM, Amanda Burma <ama...@froglogic.com> wrote:
>>> 
>>> Brzrk,
>>> 
>>>> On 12/17/14, 12:38 PM, Brzrk One wrote:
>>>> I read Amanda as wanting to convert HTML => PDF,
>>>> and Tilman wanting to convert PDF => HTML.
>>> That is correct. I want to take an HTML and convert it to PDF.
>>> 
>>> Amanda
>>>> On Wed, Dec 17, 2014 at 2:37 PM, Tilman Hausherr <thaush...@t-online.de>
>>>> wrote:
>>>>> Use a PDF for the PrintPDF feature, this works much better.
>>>>> 
>>>>> To create a HTML from PDF, use the ExtractText feature with the "-html"
>>>>> option
>>>>> https://pdfbox.apache.org/commandline/#extractText
>>>>> 
>>>>> Tilman
>>>>> 
>>>>>> Am 17.12.2014 um 20:30 schrieb Amanda Burma:
>>>>>> 
>>>>>> Hello,
>>>>>> 
>>>>>> I just found this solution, and am not certain where I've gone wrong.
>>>>>> 
>>>>>> Anyone have any tips based on the following error?
>>>>>> 
>>>>>> MandyBookAir:Downloads amanda$ java -jar pdfbox-app-1.8.8.jar PrintPDF
>>>>>> -silentPrint /Users/amanda/Documents/froglogic/Marketing/Partners/
>>>>>> Polarion/results/HTMLReports/report.html
>>>>>> PrintPDF failed with the following exception:
>>>>>> java.io.IOException: Error: End-of-File, expected line
>>>>>>     at org.apache.pdfbox.pdfparser.BaseParser.readLine(
>>>>>> BaseParser.java:1517)
>>>>>>     at org.apache.pdfbox.pdfparser.PDFParser.parseHeader(
>>>>>> PDFParser.java:372)
>>>>>>     at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:186)
>>>>>>     at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1219)
>>>>>>     at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1186)
>>>>>>     at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1111)
>>>>>>     at org.apache.pdfbox.PrintPDF.main(PrintPDF.java:100)
>>>>>>     at org.apache.pdfbox.PDFBox.main(PDFBox.java:74)
>>>>>> 
>>>>>> Thanks,
>>>>>> Amanda
>>> 
>>> -- 
>>> *View our upcoming webinars & events 
>>> <http://www.froglogic.com/news-events/events/>*
>>> --
>>> 
>>> Amanda Burma | Technical Marketing & Sales Engineer
>>> froglogic <http://www.froglogic.com> | Automated GUI Testing & Code Coverage
>>> ama...@froglogic.com | LinkedIn 
>>> <http://www.linkedin.com/groups/GUI-Test-Automation-froglogic-Squish-3774650>
> 
> 
> -- 
> *View our upcoming webinars & events 
> <http://www.froglogic.com/news-events/events/>*
> --
> 
> Amanda Burma | Technical Marketing & Sales Engineer
> froglogic <http://www.froglogic.com> | Automated GUI Testing & Code Coverage
> ama...@froglogic.com | LinkedIn 
> <http://www.linkedin.com/groups/GUI-Test-Automation-froglogic-Squish-3774650>
> 

Reply via email to