question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pdf uploaded to s3, png image is distorted/corrupt

See original GitHub issue

Hey I’m wondering if anyone has any ideas on this, it is probably not an issue of the library but thought you smart guys might have some ideas. Sorry in advance for polluting the issues 😦

I have generated my .png file using dataurl.net. When I add it to the pdf and use doc.save(), it looks great and works perfectly. However, I am trying to upload it directly to s3, using doc.output() instead, and when it gets there it looks like this: https://imgur.com/a/ZuOd0

I am using Angular FWIW and my code to PUT in to s3 looks like this:

const headers = new HttpHeaders().set('Content-Type', 'application/pdf');
this.http.put(url, file, {headers})

with file = doc.output()

Anyone have any ideas of what may cause this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18

github_iconTop GitHub Comments

2reactions
Uzlopakcommented, Feb 2, 2018

I am travelling right now. I will definitely check it out when I have better internet

0reactions
AlexBiancicommented, Jun 22, 2022

Hi. It did not work for me. Same problem also with doc.output(‘arraybuffer’); Any other solutions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

pdf uploaded to s3, png image is distorted/corrupt · Issue #1612
pdf uploaded to s3, png image is distorted/corrupt #1612 ... I have generated my .png file using dataurl.net. When I add it to...
Read more >
jspdf - pdf uploaded directly to s3 with png, png is corrupt
I am adding a png image to the pdf. I have generated my .png file using dataurl.net. When I add it to the...
Read more >
Png images getting corrupted while uploading to s3
Png images getting corrupted while uploading to s3. same upload flow works in case of jpg/jpeg/pdf Steps we are following to upload files...
Read more >
Image file becoming corrupt after upload to S3 : r/flask - Reddit
I am able to upload the file and display a link to download it. However, when I try to open the downloaded JPG...
Read more >
WHEN CORRUPTION IS THE OPERATING SYSTEM
Her work explores how corruption exacerbates international crises such as terrorism, revolutions and their violent aftermaths, and environmental ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found