Skip to main content
Participant
December 15, 2023
Answered

Creating pdf from a tif file is failing with "The input file appears to be corrupted"

  • December 15, 2023
  • 2 replies
  • 1339 views

Expected Behaviour

Creating pdf from jpeg and png is successful and hence it should be successful for tif as well.

Actual Behaviour

Its failing with error "The input file appears to be corrupted and cannot be processed"

Reproduce Scenario (including but not limited to)

const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),
CreatePDF = PDFServicesSdk.CreatePDF,    
createPdfOperation = CreatePDF.Operation.createNew(),
// Set operation input from a source file.
input = PDFServicesSdk.FileRef.createFromLocalFile("C:\\Users\\harsh\\Downloads\\adobe\\adobe-dc-pdf-services-sdk-node\\resources\\AUA Form-03272018-21902-1.tif", CreatePDF.SupportedSourceFormat.tif);
createPdfOperation.setInput(input);
 

Steps to Reproduce

As above

Platform and Version

Windows. node.js

Sample Code that illustrates the problem

Mentioned above

Logs taken while reproducing problem

node .\create-pdf-from-docx.js
Debugger attached.
No logging configuration. Using default config
2023-12-14T17:02:25.014:[INFO]: All validations successfully done. Beginning PDF conversion
Exception encountered while executing operation ServiceApiError: The input file appears to be corrupted and cannot be processed.; requestId=868b1f70-20d3-4068-a70e-75f03de9617a
at C:\Users\harsh\Downloads\adobe\adobe-dc-pdf-services-sdk-node\node_modules@adobe\pdfservices-node-sdk\src\internal\api\platform-api.js:200:12
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
requestTrackingId: '868b1f70-20d3-4068-a70e-75f03de9617a',
statusCode: 400,
errorCode: 'CORRUPT_DOCUMENT'
}

This topic has been closed for replies.
Correct answer Joel Geraci

That really depends on the way the TIF was created. Please share the file. 

2 replies

Joel Geraci
Community Expert
Joel GeraciCommunity ExpertCorrect answer
Community Expert
December 15, 2023

That really depends on the way the TIF was created. Please share the file. 

Participant
December 17, 2023

I get this error for every tiff file I tried. (I tried at least 6-7 files with and without pages).

 

Do i need to set any options for making it work ? Is above source code needs some changes ? Pasting it again for the ref. 

 

const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),
CreatePDF = PDFServicesSdk.CreatePDF,    
createPdfOperation = CreatePDF.Operation.createNew(),
// Set operation input from a source file.
input = PDFServicesSdk.FileRef.createFromLocalFile("C:\\Users\\harsh\\Downloads\\adobe\\adobe-dc-pdf-services-sdk-node\\resources\\AUA Form-03272018-21902-1.tif", CreatePDF.SupportedSourceFormat.tif);
createPdfOperation.setInput(input);

 

Inspiring
December 18, 2023

I've recently been converting TIFFs to PDF with no issue using the NodeJS SDK and PowerAutomate.   I haven't set any special options.  Have you tried the files with the SDK instead of your code?

Raymond Camden
Community Manager
Community Manager
December 15, 2023

Can you share the TIF file perhaps?