Skip to main content
Known Participant
May 18, 2023
Question

NEW ERROR: t5::corrupt_data in the PDF Embedded API viewer

  • May 18, 2023
  • 14 replies
  • 5571 views

Our viewer newly reports:

index.js:1 Exception: t5::corrupt_data,

 

The PDF is fetched through a URL. I can use the same URL to download the pdf and load it into Preview, Google Drive, Foxit viewer, etc.

 

And I can see that there was recently a new release:  https://developer.adobe.com/document-services/docs/overview/pdf-embed-api/releasenotes/#may-2023

 

Is there something we need to change on our side to get this working again?

 

Thanks in advance

This topic has been closed for replies.

14 replies

Participant
November 21, 2024

I had a similar issue. in my particular case the URL that was passed into javascript had encoding issues, which prevented the fetch operation from working.

 

I added some code  - please check my comment history for more details because it was raised in a previous comment.

 

Hopefully this tip saves someone a lot of headaches.

Participant
November 20, 2024

In my case I was passing a URL which loads a file from Amazon / Google buckets via a presigned URL.

 

You have to ensure that the URL passed into the js function does not have funky encoding.

 

const filePromise = (url) => {
  return fetch(url)
    .then((response) => response.blob())
    .then((blob) => blob.arrayBuffer());
};

const resolvedPromise = Promise.resolve(filePromise("<%== @blob.url  %>"));
//// Make sure you manage the encoding of the blob url properly.
//// in my case i am passing the url unescaped - the url is generated purely by a function
//// and without user input. so I should be safe. unless i'm missing something

document.addEventListener("adobe_dc_view_sdk.ready", function () {
  var adobeDCView = new AdobeDC.View({
    clientId: "<%= @adobe_client_id %>",
    divId: "adobe-dc-view",
  });
  adobeDCView.previewFile(
    {
      content: { promise: resolvedPromise },
      metaData: { fileName: "<%= @blob.filename  %>" },
    },
    {
      showAnnotationTools: false,
      showDownloadPDF: false,
      showPrintPDF: false,
      embedMode: "IN_LINE",
    },
  );
});

 

 

 

 

Participant
June 14, 2023

I had the same issue with files I was generating from C#. I was using PdfFileEditor object to merge two file streams. The merged file was not opening with Adobe cloud and throwing the same error. Before merging both files were correctly opening separtely. I played a lot with file properties and compliance settings but no luck. Then I changed the code, instead of merging two files I used Insert function to just add pages from one file to another one. That worked, and resultant file is same as when I was using the merge function.

 

Before:

            var pfe = new PdfFileEditor();
            using (FileStream outputStream = new FileStream(path, FileMode.Create))
            {
                pfe.Concatenate(firstInputStream, secInputStream, outputStream);
                outputStream.Seek(0, SeekOrigin.Begin);
                outputStream.CopyTo(concatenateStream);
                return concatenateStream;
            }

The above code is replaced with this:

 

            var pfe = new PdfFileEditor();
            pfe.Insert(firstInputStream, 1, secInputStream, new int[] { 1 }, concatenateStream);

I still think the problem is with some compliance settings or properties, but which one, I don't know.

Participating Frequently
June 1, 2023

I also have the same issue. For some pdfs, it says Exception: t5::corrupt_data

 

Participating Frequently
May 31, 2023

Has there been any update on this? I am still facing the sam eissue  across several PDFs . The pdfs are auto generated and the saving method cannot apply in my use case

Known Participant
May 19, 2023

Update:

We tried nearly all of the configuration parameters as we could and still never got the viewer working again.

This was failing on our production system so we had to go ahead and completely remove it. 

 

 

Known Participant
May 19, 2023

... I'm not saying there is a bug in the viewer. It seems to handle many / most PDF files with no problems. It is just that the new viewer no longer supports the PDF files that we have been producing for years which have also passed many validators.  But there is obviously something in our PDF's that the new viewer does not like.  We just didn't have time to get to the bottom of it.

 

Participating Frequently
May 20, 2023

As a workaround we found that opening the file in Adobe Reader and saving again may help.

Known Participant
May 19, 2023

Just wondering if the new viewer has any documented or undocumented configs that might affect this issue.  Like a 

 

workJustLikeThePreviousVersion:true

or 

strictMode: false

 

 

Known Participant
May 19, 2023

More detail: Here is what shows in the developer console:

 

t5::corrupt_data
    at ___cxa_throw (https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.js:1:28684)
    at self.___cxa_throw (https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.js:1:206)
    at https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.wasm:wasm-function[676]:0x57969
    at https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.wasm:wasm-function[5024]:0x3c4462
    at https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.wasm:wasm-function[10257]:0x5c1332
    at invoke_viii (https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.js:1:103321)
    at https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.wasm:wasm-function[4787]:0x386e29
    at https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.wasm:wasm-function[9497]:0x503c48
    at Module._eventHandler (https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.js:1:82931)
    at ccall (https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.js:1:79063)
    at https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/wasm_acrobat.js:1:79368
    at be (https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/acrobatProxy.js:2:79868)
    at Ae (https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/acrobatProxy.js:2:83764)
    at we (https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/acrobatProxy.js:2:85868)
    at Se (https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/acrobatProxy.js:2:85552)
    at https://acrobatservices.adobe.com/dc-rendition-provider/3.0.2_5.4.0/AJS/acrobatProxy.js:2:85830
Participating Frequently
May 19, 2023

The same.

Participating Frequently
May 19, 2023

Has the same issue which seems related to the digital signature fields available in a document.

kglad
Community Expert
Community Expert
May 18, 2023

<moved from acrobat>

Known Participant
May 18, 2023

Thanks for moving this for me.  Apologies for posting to the wrong place initially. 

Known Participant
May 18, 2023

After more testing I have verified that this the viewer does not like the bits in the pdf.  I tried with the adobe sample pdf and it works fine.

 

However, I'm still trying to sort out why it doesn't work now with the PDF'S that it used to work with just recently.

 

Is the new version of the viewer more strict with regards to the validation of the pdf?  

 

We are using Aspose PDF to programmatically build the PDFS and they were working without issue up until recently.

 

Thanks for any help you can provide.