HTML to PDF

Overview

Version 1.0.0 - Accepts inline and internal styles and also adds images in the PDF if they are publicly hosted. Based on content, multiple pages will be created in the PDF. The Smart Service will accept HTML files with properly closed tags including <br> and <img> tags otherwise the node will be errored out.

Version 2.0.0 - Everything with Version 1.0.0 and ability to generate PDF from HTML with landscape orientation.

Key Features & Functionality

Inputs

  • Source Document (Document) - The html file to be converted into PDF.
  • New Document Name (Text) - Name for the newly created PDF Document.
  • New Document Desc (Text) - Description of the output PDF Document.
  • Save In Folder (Folder) - Folder to which the output PDF Document to be saved in.

Outputs

  • New Document Created (Document) - The output PDF file.
  • Error Message (Text) - Error message received.
  • Error Occurred (Boolean) - Set to true on the occurrence of error.
Anonymous
  • Hi Ben,

    I am facing the same error.

  • FYI, new version is throwing an error and pausing process execution:

    2022-09-26 15:33:18,796 [Appian Work Item - 172 - WorkID 107 - execution02 - process 536871483 - model 1172 : UnattendedJavaActivityRequest] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=536877167, classname=com.vuram.plugins.htmltopdfconversion.HtmlToPdfConversion
    java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.createInstance(DefaultActivityExecutor.java:247)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.createActivityInstance(DefaultActivityExecutor.java:211)
    	at com.appiancorp.process.runtime.framework.DefaultUnattendedActivityExecutor.validate(DefaultUnattendedActivityExecutor.java:18)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:84)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequestResponseCreator.getJavaActivityResultResponse(UnattendedJavaActivityRequestResponseCreator.java:21)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.getJavaActivityResultResponse(UnattendedJavaActivityRequest.java:67)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.common.persistence.data.AppianDataUserContextProvider.executeWithConsistentDataReads(AppianDataUserContextProvider.java:143)
    	at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:129)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:110)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:750)
    Caused by: java.lang.Error: Unresolved compilation problems: 
    	The import org.apache.log4j cannot be resolved
    	Logger cannot be resolved to a type
    	Logger cannot be resolved
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    	Logger cannot be resolved to a type
    
    	at com.vuram.plugins.htmltopdfconversion.HtmlToPdfConversion.<init>(HtmlToPdfConversion.java:12)
    	... 20 more

  • v2.1.1 Release Notes
    • Security patch updated
  • Currently, this plugin doesn't support the Arabic language, will update the plugin in future versions.

    Thank you for reaching out.

    Thanks,
    Vignesh E   

  • this plug-in support Arabic language?

    if yes what's font document should I use?

  • it was a css class issue . Please try to remove unnecessary class from the the head part of the html and try.

  • Hi, I am having exactly the same case. At the beginning I am getting a blank page!  did you find a solution to this? Please let me know!

    Thanks

    Bujar

  • Hi Manish,

    Please share the HTML file you are using for generating the pdf with us. We will check and get back to you.

  • Hello Team,

    While generating the pdf using this plugin , I am getting a blank page in the start of the pdf. Can you please let us know why it is coming ? or  what html tags are causing this blank page ?.  The pdf contains only 1 page but after the generation a blank page comes as page one and the content in the next page.

    Please suggest.

    Thanks 

    Manish

  • Hi

    I have an html with images embedded in the body itself. But for such scenario the HTML to PDF converter is not working. I get error as follows:

    "java.lang.Exception: Error while generating the PDF file. The PDF file will not be available."

    If i check the html code; the html code has the image source mentioned in <img src> tag. 

    How can i get it resolved, kindly help!!