Quantcast
Channel: Adobe Community : Popular Discussions - LiveCycle PDF Generator
Viewing all articles
Browse latest Browse all 31905

htmlFileToPDF only works with a ZIP file

$
0
0

Hello everybody.

 

I'm writing a simple Java program with Eclipse as to test the htmlFileToPDF API call.

 

According to the docs, this API ""Creates a PDF document from an input HTML file or a ZIP file containing HTML files and/or Image files. For ZIP files, this method searches the ZIP contents for the index.html file. It then uses the index.html as the document root."

 

So I created a simple Java program (mostly taken from http://help.adobe.com/en_US/livecycle/9.0/programLC/help/000213.html#1548718 - Converting HTML content to a PDF document using the Java API) but it only seems to work when the inputDocument is a ZIP file which contains the index.html file.

 

As an examples, considering the following lines:

 

        FileInputStream is = new FileInputStream("C:\\index.html");
     Document inHTML = new Document(is);
     HtmlToPdfResult result = pdfGenClient.htmlFileToPDF(
          inHTML,
          ...
          ...
     );

 

With the above example, when the class executes I got the following exception:

 

     ALC-PDG-080-019-Input file File.zip does not contain the index html file

 

If I change the first line to read

 

        FileInputStream is = new FileInputStream("C:\\test.zip");

 

and the test.zip file does contain the index.tml file, everything works as expected.

 

What am I missing?

 

Thanks,

Rob


Viewing all articles
Browse latest Browse all 31905

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>