Skip to main content
Participant
August 4, 2022
Question

Compressing PDF - Internal Server Error

  • August 4, 2022
  • 1 reply
  • 379 views

Hi there,

 

I hope this is the right place to post. We just began using the adobe sdk for node and are running into a problem.

We are attempting to compress a PDF that is about 80 MB.

 

I tried making a proof of concept to see if this would work. I followed the exact code that the intro docs have and put it into a simple express app.

app.get('/', (req, res, next) => {
    const credentials = PDFServicesSdk.Credentials
        .serviceAccountCredentialsBuilder()
        .fromFile("pdfservices-api-credentials.json")
        .build();

    const executionContext = PDFServicesSdk.ExecutionContext.create(credentials),
        compressPDF = PDFServicesSdk.CompressPDF,
        compressPDFOperation = compressPDF.Operation.createNew();

    const input = PDFServicesSdk.FileRef.createFromLocalFile('test-2.pdf');
    compressPDFOperation.setInput(input);
    compressPDFOperation.execute(executionContext)
        .then(result => result.saveAsFile('compressPDFOutput.pdf'))
        .catch(err => {
            if (err instanceof PDFServicesSdk.Error.ServiceApiError
                || err instanceof PDFServicesSdk.Error.ServiceUsageError) {
                console.log('Exception encountered while executing operation', err);
            } else {
                console.log('Exception encountered while executing operation', err);
            }
        });
});

 

When I hit the endpoint I get a log saying that all validations were successful, but after about 5 minutes I get an error that says: Exception encountered while executing operation ServiceApiError: Error occurred while processing the request; transactionId=zfGcEYqzqSadns5DR4U4QwcppboEdBSu

 

And then in the error stack that is logged I also have the requestTrackingId:
requestTrackingId: 'oxZiI0zgGyLO6F4BQuIcuevoIhk8zfyS'

 

I can't imagine Adobe wouldn't be able to handle files of 80 MB. We plan on using this commercially and paying for this service, but I can't even get the intro docs to work correctly which worries me.

 

Any help/suggestions would be greatly appreciated!

    This topic has been closed for replies.

    1 reply

    Participant
    June 6, 2023

    Hi, I am facing the same issue. Did you find the solution

    Participant
    June 11, 2023

    Hi, I am facing the same issue. Did anyone have solution