Skip to main content
Participant
Dec 15, 2023 5:27 AM UTC
Answered

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

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 is closed to new replies. Start a new post to keep the conversation going.
Joel Geraci
Joel GeraciCorrect answer
Community Expert
Dec 15, 2023 4:22 PM UTC

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

6 replies

Joel Geraci
Community Expert
Joel GeraciCommunity ExpertCorrect answer
Community Expert
Dec 15, 2023 4:22 PM UTC

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

Translate
Participant
Dec 17, 2023 4:38 AM UTC

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);

 

Translate
Inspiring
Dec 18, 2023 1:15 PM UTC

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?

Translate
Raymond Camden
Community Manager
Community Manager
Dec 15, 2023 2:39 PM UTC

Can you share the TIF file perhaps?

Translate