mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.59k stars 9.99k forks source link

Canvas scaling affects the fillText quality in Opera and Chrome #1477

Closed guaranis closed 11 years ago

guaranis commented 12 years ago

I tried to see the following pdf as an example:

http://www.dlshq.org/download/easysteps.pdf

Opera: not working, the police is wrong IE: Don't know, I cannot even load the file. Chrome: working but the police is ugly

it is working only with mozilla, 30% of the web. willing to pay to have something like crocodoc, the viewver not the share thing.

saebekassebil commented 12 years ago

Thanks for reporting this bug! It's great that you've taken the time to report this issue. Next time you report a bug it'd be much helpful if you wrote something about what exactly "is not working" - That makes it easier to file this issue properly, and to assign it to someone.

The goal of PDF.js is (to my knowledge) not to support all major browsers, but to deliver a product while exploring the needs for new JavaScript API's. That said we aim to support all browsers with reasonable HTML5 support - Which IE8-9 doesn't have. We rely on the relatively new File API to open files, but IE does not support this.

Chrome: Works for me - On which page is the "police" to be found? Opera: The font appears to big, this just might be the same issue as #187

gigaherz commented 12 years ago

At the moment, pdf.js only works properly in firefox and chrome.

I tried the viewer (http://mozilla.github.com/pdf.js/web/viewer.html) using pdf.js (Firefox 11 and Chrome 18), and compared it to Adobe Reader X 10.2. I can't see any difference between them. Where is the issue exactly? (upload pictures somewhere of the issue if you can)

pdf.js is still in development, so be patient. There's many pdf viewers you can use meanwhile.

I don't understand the last sentence, but you don't have to pay for PDF viewers: http://alternativeto.net/software/adobe-reader/?license=free

If you don't want to use Adobe Reader, then Foxit Reader and Sumatra PDF are both good and free, Sumatra is also opensource if you also want to avoid propietary software.

gigaherz commented 12 years ago

@saebekassebil I doubt it's minimum font size because the issue happens also with large zoom levels, Opera is just not using the right font size, possibly not understanding pdf.js's output correctly.

guaranis commented 12 years ago

this is what I see: http://2loq.com/pdf.js/web/moz.png http://2loq.com/pdf.js/web/ie.png http://2loq.com/pdf.js/web/chrome.png http://2loq.com/pdf.js/web/opera.png

not sure if the problem is in my computer

gigaherz commented 12 years ago

Weird, that's not how it looks to me on chrome at all... Even if it still doesn't work, my results on Opera are also not like yours, either. There MAY be something wrong with your computer.

Can you provide more details? Which Operating System are you using? What language is it set to? What version of Chrome?

guaranis commented 12 years ago

It looks like the results are different with another computer but with the other computer the police for viewer2 and 3 are small squares.

I am using windows 7 and all browser latest. (chrome 18) language set to engilsh I have uploaded 3 different pdfs http://2loq.com/pdf.js/web/viewer.html http://2loq.com/pdf.js/web/viewer2.html http://2loq.com/pdf.js/web/viewer3.html

guaranis commented 12 years ago

for some reasons pdfs created by libreoffice, openoffice, zamzar etc are causing problems. the same source odt or doc converted by other converters works fine in chrome

notmasteryet commented 12 years ago

The PDF does not contain embedded for the bad looking fonts, the browser/pdf.js uses fonts installed on your system. Looks like the other browser cannot handle the system fonts.

guaranis commented 12 years ago

I did some tests for chrome with 2 computers. pdfs created by, nitro, open office, primopdf are not working fine (fonts are small square) the ones created by cuteftp or convertonlinefree.com (online) are working fine http://2loq.com/pdf.js/web/GettingIntroducedToOilPainting-nitro.pdf http://2loq.com/pdf.js/web/GettingIntroducedToOilPainting-cute.pdf http://2loq.com/pdf.js/web/GettingIntroducedToOilPainting-office.pdf http://2loq.com/pdf.js/web/GettingIntroducedToOilPainting-primo.pdf http://2loq.com/pdf.js/web/GettingIntroducedToOilPainting-convertonlinefree.pdf

gigaherz commented 12 years ago

The nitro pdf (http://2loq.com/pdf.js/web/GettingIntroducedToOilPainting-nitro.pdf) throws an error in the Web Console (tried Firefox, Aurora and Nightly.

[22:00:49.072] properties.baseEncoding is undefined @ http://2loq.com/pdf.js/web/GettingIntroducedToOilPainting-nitro.pdf:15658
[22:00:49.079] this.objs.objs[fonts[i]] is undefined @ http://2loq.com/pdf.js/web/GettingIntroducedToOilPainting-nitro.pdf:252
guaranis commented 12 years ago

I can get good results using novapdf to create the pdf and not using fonts like times roman. This works also with opera http://2loq.com/pdf.js/web/nova.html

1 question: does pdf.js load the entire ebook or it can stream the page loading (page by page) ?

gigaherz commented 12 years ago

At the moment, it downloads the whole PDF first, and then begins to draw the pages. They have been considering how to work on that (see #1375 and #1108) but as far as I know, work on that feature has not yet begun.

ghost commented 12 years ago

its doesn't work my computer,too,ugly

ghost commented 12 years ago

in my chrome browser ,the result like this GitHub

bursteg commented 12 years ago

IE10 (on Windows 8) supports File API, but I can't open PDF files. Are you working on Windows 8 support?

gigaherz commented 12 years ago

As far as I know, the main focus is for pdf.js to work in Firefox, but being as standards-compliant as possible so that it can also work in other browsers.

In my opinion, if any of the issues preventing pdf.js from working in IE10 are within pdf.js and not just missing features or Microsoft not following the standards, then it would be interesting to fix them, and if the issues can be worked around with a small code snippet in the compatibility.js file that already exists, then it could also be worth doing them, but if the changes would require messing with the code so that it does things wrongly on purpose only to work in IE10, then no one should waste time on that.

saebekassebil commented 12 years ago

@bursteg Are you getting any errors?

bursteg commented 12 years ago

In the IE JS console I get:

SCRIPT438: Object doesn't support property or method 'overrideMimeType' l10n.js, line 117 character 5

yurydelendik commented 12 years ago

@guaranis the font display issues were reported upstream:

- to the Chrome team: https://code.google.com/p/chromium/issues/detail?id=140788
- to the Opera team: DSK-358788

You are welcome to ping them again. Small test case: https://bug726227.bugzilla.mozilla.org/attachment.cgi?id=596220

IE9 does not support opening file, but looks good when deployed on the local web server. Changing the title to reflect the real issue and avoid the unnecessary discussions.

@bursteg please report IE10 as a separate issue -- it's off-topic here.

yurydelendik commented 11 years ago

Shall be resolved by #3104