Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Internet Explorer 8 compability layer #136

Closed
micred opened this issue May 6, 2013 · 7 comments
Closed

Internet Explorer 8 compability layer #136

micred opened this issue May 6, 2013 · 7 comments

Comments

@micred
Copy link

micred commented May 6, 2013

Sadly enough IE8 has still 8.10% of Internet users.
There are situations where IE8 is needed :-( how can we make pdf2htmlex compatible with legacy browsers?

Do you have suggestions? What are the pitfalls? Crocodoc works with IE8 (not yet the 'preview' version).

I see that EOT font conversion is needed, since TTF is not supported but it's not a big deal.
I think that there are also problems with absolute units (like the "pt").
There are problems with scaling, since using of transform CSS.

If making all the stuff IE8-proof is too complicated (or make the code full of dirty workarounds) I was thinking about a legacy version that render the document to image (pdf2image) and put transparent text over it (just to make it searchable and selectable).

@coolwanglu
Copy link
Owner

I really don't want to put too much efforts into supporting legacy browsers, there are even people asking about IE6 and Firefox 2...

But there is --fallback available, which might be what you want.

@micred
Copy link
Author

micred commented May 6, 2013

--fallback is what I meant. But there still are problems with size and position of overlying text.
I know you don't want to put efforts on legacy browsers, but do you think there are many pitfalls?
Can you give me hints of what is needed to do?
Thanks

@coolwanglu
Copy link
Owner

Still about 'fallback', the size and position should be actually the same as in the normal mode, this parameter was originally designed for text that are covered by images, which should be hidden, but pdf2htmlEX would reveal them by design. Therefore if normal mode does not work, fallback mode won't either.

There are probably two problems, font and size. About font perhaps #83 would help, with woff or eot. It would be implemented in the future, probably when woff becomes popular. But My problem is that I don't have a Windows that I can install softwares... I am not against patches though, as long as they don't bring in too many ugly workarounds.

About size, I remember that IE 8 does not support CSS transform? In that case, you may want to try setting 'font-size-multiplier' to 1, which might work (maybe even for normal mode).

Sorry that I don't have the environment to verify my guesses.

@micred
Copy link
Author

micred commented May 6, 2013

WOW! Exactly, CSS transforms not supported and --font-size-multiplier 1 make a great change! Thank you, results seems acceptable, I will test it deeper on older browsers.

@Mysrt
Copy link

Mysrt commented May 16, 2013

@micred can you elaborate a bit on how you were able to get this working for IE8? For me its just text with no formatting. If possible I would like to get this passable for those users as well.

@micred
Copy link
Author

micred commented May 17, 2013

Well, it's a bit complex and results are not great.
Using --font-size-multiplier 1 results can be acceptable because viewer depend less on css transform, that are not supported by IE8.
IE8 has zoom property that are similar to transform:scale() so you can patch the code to use zoom property, but it's not a definitive solution. In many cases you can't rely only on scale (think about rotated text/pages). You can think about using -ms-filter with the transformation matrix provided by pdf2htmlEX, but you can't set the transformation origin in IE8, so you should also do a translation matrix after that. Here's some details:
http://www.useragentman.com/IETransformsTranslator/doc.html
https://github.com/heygrady/transform/wiki/correcting-transform-origin-and-translate-in-ie

Than you should convert fonts to EOT.

Anyway try with --fallback 1 and you get raster image of the pdf with transparant text overlied (be careful: position of the transparent text is the same as with --fallback 0).

@coolwanglu
Copy link
Owner

Still I think the compatibility to IE8 is not a worthy job. There are quite a few essential things that have to be compromised. So I'm closing this issue.

Thanks for reporting.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants