Skip to main content
Participant
January 10, 2025
Question

Getting CORRUPT_DOCUMENT error when polling for status

  • January 10, 2025
  • 1 reply
  • 387 views

I created a new template for my internal demo and gettign this error message.

 

com.adobe.pdfservices.operation.exception.ServiceApiException: description ='The input file appears to be corrupted and cannot be processed.; requestId=ab4180cf-d0c5-4db7-81d2-8dda5afb4ce7'; requestTrackingId='5760077d-9505-4c25-bbe0-36b9d157d63a'; statusCode=400; errorCode=CORRUPT_DOCUMENT

 

I had several tempalte screate 4-5 weeks back and all are still working fine. Event If I upload the same old template again, it works file. But If I re-save the same old template and upload, I get this error. After all the trubleshooting, I conclude that there could have been updates to my Microsfot Office in last 4-5 weeks and that started this problem where the API thinks the file is corrupted. 

 

Can you please using the trakcing ID get some logs and help me so I can complete my evaluation process and provide demo internally for purchanse decision?

 

Thanks.

    1 reply

    Joel Geraci
    Community Expert
    Community Expert
    January 13, 2025

    That sounds right. Can you share your original before and after templates?

    Participant
    January 15, 2025

    Thanks Joel for looking into this issue. I am attaching the three templates.  The salesOrderTemplate.docx is the original one provided in Java SDK for testing. It works fine when java class MergeDocumentToPDF is run for PDF generation. 

     

    I open up the salesOrderTemplate.docx in my MS-Words and just resaved it as salesOrderTemplate-resave.docx. I ran the same Java SDK program MergeDocumentToPDF using SalesOrder JSON. It returned the following exception...

     

    com.adobe.pdfservices.operation.exception.ServiceApiException: description ='The input file appears to be corrupted and cannot be processed.; requestId=e3c7a80c-d9f3-404e-995a-559a22e57b69'; requestTrackingId='0318fbf9-d449-4aba-bb90-ced21052c809'; statusCode=400; errorCode=CORRUPT_DOCUMENT
    at com.adobe.pdfservices.operation.internal.PDFServicesHelper.pollJob(PDFServicesHelper.java:347) ~[pdfservices-sdk-4.2.0.jar:4.2.0]
    at com.adobe.pdfservices.operation.internal.PDFServicesHelper.getJobResult(PDFServicesHelper.java:224) ~[pdfservices-sdk-4.2.0.jar:4.2.0]
    at com.adobe.pdfservices.operation.PDFServices.getJobResult(PDFServices.java:132) ~[pdfservices-sdk-4.2.0.jar:4.2.0]
    at com.adobe.pdfservices.operation.samples.documentmerge.MergeDocumentToPDF.main(MergeDocumentToPDF.java:93) [classes/:?]

     

    It was working fine almost 4-5 weeks back. If I create any template, even a template with just one line and JSON tag. The PDF generation fails with the same error. 

     

    However, Please note if I change the output format to DOCX, then it works fine.

     

    As a workarond, if I upload the template to my Gogole drive, open it up in Gogle Doc, save it as Gogle Doc, then download it as Words DOCX. The the PDF generation works fine. I have attahced the file salesOrderTemplate-resave-googledoc.docx created thru google doc hack. However, gogle doc distorts the template formatting in some cases and therefore cannot be used for all templates.   

     

    I feel the issue is related to PDF generation and statred recently, perhaps due to updates in Microsoft Words.

     

    Please let me know if you anything else.

    Joel Geraci
    Community Expert
    Community Expert
    January 15, 2025

    Thanks. I have Enginering looing into it now. Your files will be very helpful.