Expand my Community achievements bar.

Converting an HTML document to a PDF document using the web service API

Avatar

Level 1

Hi,

I am trying to use the example code in "Quick Start: Converting an HTML document to a PDF document using the web service API". but I have some problems.

I want to convert a website to a PDF-document using a webservice installed on a server. I created a new Windows Console Application in VisualStudio and added a Serviced Reference called GeneratePDFService. I am using .NET 3.5 C#. I have LiveCycle 8.2 (I think?).

The beginning of the code looks like this:

// Create a GeneratePDFServiceService object 
GeneratePDFServiceService pdfGenClient = new GeneratePDFServiceService();  

// Provide authentication credentials to the service 
pdfGenClient.Credentials = new System.Net.NetworkCredential("administrator","password");

The problem is that the namespace GeneratePDFService does not contain the class GeneratePDFServiceService nor GeneratePDFService. It does contain a class called GeneratePDFServiceClient but that class does not contain the property Credentials (but a class ClientCredentials that is readonly).

Any suggestions about what can be wrong or how to proceed?

Thanks in advance!

Regards, Malin.

3 Replies

Avatar

Level 1

Hi again,

I started an new ASP.NET Web Application in Visual Studio and copied all my code. Then all code was compiled. I guess the problem was that I used a Windows Console Application before.

So, now I can run my code but I get an error message saying:

"ALC-PDG-80014-000: com.adobe.livecycle.generatepdf.client.ConversionException: ALC-PDG-080-014-Html to pdf conversion failed because of an exception.\nERROR encountered loading http://www.adobe.com: java.net.ConnectException: Connection refused: connect\nCaused by: coldfusion.document.DocumentProcessor$RenderException: ERROR encountered loading http://www.adobe.com: java.net.ConnectException: Connection refused: connect\n\tat coldfusion.document.DocumentProcessor.processContent(DocumentProcessor.java:282)\n\tat coldfusion.document.DocumentProcessor.processContent(DocumentProcessor.java:177)\n\tat com.adobe.pdfg.html2pdf.Html2PdfConverter$URLConverter.run(Html2PdfConverter.java:445)\n\tat...etc...

I used the default username (administrator) and password (password) when trying to connect. But as it says Conenction Refused, I guess the password has been changed after the installation of LiveCycle? (It wasn't me who installed it.)

Avatar

Level 1

The problem is solved. In the example the url was set to www.adobe.com and when I changed this it worked.

Avatar

Level 1

Try this html to pdf library which supports HTML 5 features.