PDF Tools

Overview

Contains multiple Smart Services and Functions for interacting with PDF Documents.

Key Features & Functionality

Smart Services:

  • Merge PDF - Merges multiple PDF documents into a single document.
  • Extract PDF Pages - Extracts a range of pages from an existing PDF into a new PDF.
  • Fill PDF - Populates the fields of a PDF Form and optionally flattens it disallow further changes.
  • Create PDF Content - Allows text to be added to a PDF with control over the style, position, and angle. An existing PDF can be updated or a new one created from scratch.
  • Convert PDF to Image - Creates an array of images or a multi-page tiff from a PDF.
  • Compress PDF - Compresses the images in the PDF to make it smaller.
  • Un-protect and Copy PDF - Using the document password, create an un-protected copy of a protected PDF.
  • Convert Image to PDF - Creates a PDF starting from one or many images. It also supports multi-page tiff images.
  • Encrypt PDF - Encrypts an existing PDF with a password.

Functions:

  • Get PDF Metadata - Retrieves metadata on the PDF: page count, title, author, security, encryption, etc.
  • Get PDF Text - Retrieves the text content from a PDF.
  • Get PDF Form Fields - Retrieves the populated form field values of an unflattened PDF.
  • Get PDF Signature Fields - Retrieves the populated signature field values of an unflattened PDF.
  • Get PDF Bookmarks - Retrieves the raw list of bookmarks in the PDF.

Anonymous
  • I am getting below error with this version of the plugin. I have tried removing and re-installing the plugin. I am on Appian 23.4.

    Unable to load class 'javax.imageio.ImageReadParam' because the bundle wiring for pdftools is no longer valid.
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1548)
    at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1986)

  • I am getting this error on above plugin version, Appian version is 23.4, Cloud.

    Exception in thread "ThreadPoolTaskExecutor-62870" java.lang.NoClassDefFoundError: javax/imageio/ImageReadParam
    at com.github.jaiimageio.impl.plugins.tiff.TIFFImageReaderSpi.createReaderInstance(TIFFImageReaderSpi.java:118)
    at javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320)
    at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:529)
    at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:513)
    at com.appiancorp.ps.pdftools.ConvertImageToPDF.run(ConvertImageToPDF.java:77)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:136)
    at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:54)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:136)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:130)
    at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:28)
    at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:130)
    at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:88)
    at com.appiancorp.process.engine.UnattendedJavaActivityRequestResponseCreator.getJavaActivityResultResponse(UnattendedJavaActivityRequestResponseCreator.java:22)
    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:241)
    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.ClassNotFoundException: Unable to load class 'javax.imageio.ImageReadParam' because the bundle wiring for pdftools is no longer valid.
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1548)
    at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1986)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)

  • v2.5.0 Release Notes
    • Updated deprecated APIs, added license file and updated min version to 23.2
  • Hi,

    I am getting below error when I use the getpdftext function.

    An error occurred while evaluating expression: pdfText:getpdftext(pv!rulesforInclusionpdf) (Expression evaluation error at function 'getpdftext': Error: Header doesn't contain versioninfo) (Data Outputs)

    PDF document referenced in the function is generated from docx using pdf from docx

    Any help is much appreciated. Thanks!

  • Hi, thanks for the reply! Unless there is another way to check in Appian, if there is the PDF is formed correclty, exactly that could be a good behavior.... A null might be fine. A null should mean that the function could not get any fields from the PDF. If the function response is null, it means there is no metadata and should mean that something is going on with that PDF and it is invalid. 

  • Hi mikel,
    tbh this will be hard to maintain properly. I mean we are talking for a reason about "corrupted PDF". 
    And if you dont have a valid PDF, how can the function be working on a reasonable level as "PDF tool" function?
    What would be your expected behavior? No error?

    kind regards,
    Richard

  • Hi! 

    We have a problem when we use getpdfflieds on a corrupted PDF. Sometimes our users upload this kind of PDF documents and we don't know how to control it. Would it be possible that this implementation exists in the current plugin and at least the function doesn't fail? It would be enough for us to throw a null. 




    Thank you!

  • Common issue with .docx templates with fields which are being merged like the following in the final PDF conversion. 

    [SOLUTION] Ensure spacing is removed for all paragraphs:

    [EXPLANATION] It appears that adding custom spacing throws off the PDF converter and merges fields in an unpredictable way, resort to using simple newline characters. 

  • @naeemm3619 were you able to resolve this?