Content Management and Capture

 View Only
Expand all | Collapse all

How to ignore pdf security settings during Pdf to Tff conversion?

  • 1.  How to ignore pdf security settings during Pdf to Tff conversion?

    Posted Thu May 14, 2020 10:09 AM

    Hello,

    We are getting the following error when we try to convert a PDF to TIFF. The PDF can be opened and viewed without a password but has security enabled for content copying. Currently we have a time-consuming manual workaround to open the pdf and recreate it as PDF again, which removes the security.

    Is there another way to bypass the security? We don't have the option to request the sender to remove the security in the source PDF.

    The file TM00001.pdf  has access restrictions. ,  ,    at FREngine.IEngine.GetNumberOfPagesInImageFile(String ImageFilePath, IImagePasswordCallback PasswordCallback)

       at Datacap.Libraries.Convert.PdfFRE.ExtractTIFFsFromPDFEx(String filePath, Boolean useFastBinarization, Int32 jpegQuality, Int32 resolution, Int32 compressionBW, Int32 compressionColor, Int32 compressionGray, String extensionBW, String extensionColor, String extensionGray, Int32 convertMode, Int32 maxPagesForInMemProcess, String language, Boolean createLayout, Boolean reuseTextInSearchablePdf, String log, String saveDocument, String correctSkewMode)

    10:33:34.261 (0) t:16A8 p:10AD670 System.Runtime.InteropServices.COMException (0x80004005): The file TM00001.pdf has access restrictions.

       at FREngine.IEngine.GetNumberOfPagesInImageFile(String ImageFilePath, IImagePasswordCallback PasswordCallback)

       at Datacap.Libraries.Convert.PdfFRE.ExtractTIFFsFromPDFEx(String filePath, Boolean useFastBinarization, Int32 jpegQuality, Int32 resolution, Int32 compressionBW, Int32 compressionColor, Int32 compressionGray, String extensionBW, String extensionColor, String extensionGray, Int32 convertMode, Int32 maxPagesForInMemProcess, String language, Boolean createLayout, Boolean reuseTextInSearchablePdf, String log, String saveDocument, String correctSkewMode)

    10:33:34.261 (0) t:16A8 p:10AD670 PDF to TIF extraction complete.

    10:33:34.261 (0) t:16A8 p:10AD670 Conversion exception encountered: The file TM00001.pdf pdf has access restrictions.

     

    Thank you.

     



    ------------------------------
    KT
    ------------------------------


  • 2.  RE: How to ignore pdf security settings during Pdf to Tff conversion?

    Posted Fri May 15, 2020 10:52 AM
    i don't think anyone can do anything about it yet, because it's not an issue with Datacap or the OCR engine(ABBYY's FineReader in this case) used by Datacap.

    In fact, it's not an issue with anything trying to "process" in this way any PDF disabled with content copying.  Like you said, you'd need to remove that security, which is to enable "content copying".

    I don't remember in my experience if we'd use something like Acrobat Pro, without the privilege to disable that setting on a respective PDF, even copy/save the PDF into a new one without the security on content copying.  (A different thought would be that, if it's possible to do that without the privilege, this security setting on content copying would be meaningless.)

    ------------------------------
    Long Yang
    ------------------------------



  • 3.  RE: How to ignore pdf security settings during Pdf to Tff conversion?

    Posted Fri May 15, 2020 05:21 PM
    Edited by Kteegala Thu October 14, 2021 11:40 PM
    Hello Long,
    Thank you for your reply.  What I am looking for is a way to automate our manual process ( programmatically recreate PDF or printToPDF and disable security ) by a custom action/Scripting before PDF reaches the TIFF creation phase. I was wondering if Datacap or Abby's FrEngine API provides a way to do this.

    The below article suggests there is a way to bypass security, but they recommend using PDFDocumentToImage which is deprecated and not supported in future releases. I am not sure if VeryPDF is an option in 9.14 version which we use.

    According to this article, 
    https://www.ibm.com/support/pages/unable-convert-secured-pdf-file-convert-actions-ibm-datacap

    The PDF document security does not allow for extraction of pages. Datacap complies with this setting.
    Two solutions:
    1. The security will need to be change on the PDF, so that security settings will not interfere with the extraction.
    2. Use the PDFDocumentToImage action, since it does not follow the same behavior as the PDFFREDocumentToImage action. The PDFDocumentToImage action allows the conversion of secured PDF files.
    a. Note that the PDFDocumentToImage action was changed in 9.1.1 to default to using the Abby engine as well. You can re-enable use of the VeryPDF engine in 9.1.1 +hotfix or 9.1.3 or higher by setting a variable named SelectPDFEngine to a value of 1 (e.g. rrset("1","@P.SelectPDFEngine")). If the variable is present and set to 1, then PDFDocumentToImage will use the VeryPDF engine. Otherwise, the Abby engine will be used.





  • 4.  RE: How to ignore pdf security settings during Pdf to Tff conversion?

    Posted Fri June 26, 2020 10:15 AM
    Edited by System Wed July 15, 2020 10:12 AM