Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image in PDF doesn't load #6967

Open
tonyjin opened this issue Feb 10, 2016 · 7 comments

Comments

@tonyjin
Copy link
Contributor

commented Feb 10, 2016

Tested in both Chrome and Firefox. Image in page 10 of the attached PDF (labeled page 8 in the document) doesn't load.

The Chrome native viewer and Adobe Reader both load the image properly.

temp_portfolio658660046914130129 (1).pdf

@timvandermeij

This comment has been minimized.

Copy link
Contributor

commented Feb 10, 2016

I can confirm this using Windows 10 x64, Firefox 44.0 and the latest PDF.js development version. It's unfortunate that there are no console messages about this.

@SamyCookie

This comment has been minimized.

Copy link

commented Feb 10, 2016

Same behaviour on Linux Debian stretch (testing), FF 44 and trunk pdf.js version. No console logs.

@brendandahl

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2016

The images are decoded fine. You can observe this by doing the following in paintInlineImageXObject() in canvas.js

--- a/src/display/canvas.js
+++ b/src/display/canvas.js
@@ -2067,6 +2067,13 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
         var tmpCtx = tmpCanvas.context;
         putBinaryImageData(tmpCtx, imgData);
         imgToPaint = tmpCanvas.canvas;
+
+        var div = document.createElement('div');
+        var imgData = tmpCtx.canvas.toDataURL();
+        var img = document.createElement('img');
+        img.src = imgData;
+        div.appendChild(img)
+        document.querySelector('#viewerContainer').appendChild(div);
       }

Seems to be an issue with how they're drawn. Quick look seems like the coordinates are messed up, but I'll have to look into it more later.

@Snuffleupagus

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2016

Skipping the SMask case in CanvasGraphics_setGState "fixes" all the missing images in this PDF file, hence this issue is unfortunately yet another regression from PR #4161.

@Snuffleupagus Snuffleupagus referenced this issue Feb 20, 2016

Closed

[Tracking] SMask regressions from PR 4161 #7011

3 of 5 tasks complete
@yurydelendik

This comment has been minimized.

Copy link
Contributor

commented Apr 11, 2016

Looks like we are not handling AIS=false state properly. Switching mask off for this case helps the case.

@groovy21

This comment has been minimized.

Copy link

commented Jun 9, 2017

Can someone please fix this issue in pdf js. This issue has ruined our experience in an application that is in production. If we dont get a fix we will have to abandon pdf.js and move to a different product. I dont want to do that as I find pdf.js really simple in its UI and dependencies.

@SamyCookie

This comment has been minimized.

Copy link

commented Jan 8, 2018

For reference, some images at page 6-8-10-14 are still missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.