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

Webkit performance problem #19

Open
tomas-net opened this issue Jan 31, 2019 · 6 comments
Open

Webkit performance problem #19

tomas-net opened this issue Jan 31, 2019 · 6 comments

Comments

@tomas-net
Copy link

pdf2htmlEX faces to performance issues in Webkit-based browsers (mainly Safari macOS and iOS + Epiphany on Linux). Epiphany is good browser for testing because not everybody can access Apple devices. Whole page is slowly rendered, sometimes browser just crashes and if loaded then scrolling is too slow and browser keeps repainting whole page (instead of neccessary parts).

Blink engine (Chrome, Edge) is working fine.

If you use element inspector in browser and uncheck CSS rule position: absolute on #page-container, everything will be OK (but this breaks other things like AJAX loading - it loads all pages, etc.).

I tried to get rid of position: absolute and rewrite CSS styles for sidebar and page-container to display: flex (visual look was the same and performance issues remained). After that I tried to rewrite CSS styles to display: inline-block - visual look was the same and performance issues remained and different issues occured in other browsers.

@jeroenjeremy
Copy link

I can confirm these problems. They are especially visible with longer documents. Our approach might be to convert the document to an html per page but that's not as elegant.

@tomas-net
Copy link
Author

jeroenjeremy: I believe that problem consist only in CSS or JS (something triggers repaint). If it is working fine in other browsers (even IE11!) I do not see a reason why change anything else. And from.my experience even 10 pages is enough to see problems

@Rockstar04
Copy link
Member

For long, or technically complex PDF's converting to individual pages and writing a custom viewer that handles dynamically loading and unloading pages as they come in and out of the viewport will probably be your best bet.

Depending on the size of the PDF you are trying to convert, you could also try adjusting the conversion settings (--heps, --veps) to reduce the number of elements that are created.

@tomas-net
Copy link
Author

I forgot to mention one important information. I use pdf2htmlex with --split-pages 1. so all pages are loaded dynamically from server using ajax (I use default pdf2htmlex viewer). I use default value 3 for number of pre-loaded pages.

So performance problem is not related to the length of original PDF (I tried 400 pages and 10 pages = same result). Problem must be somewhere in JS and CSS because when trying to load index.html with fonts, css and js I still have performance issues, it barely loads first page.

If I use element inspector in browser and uncheck CSS rule position: absolute on #page-container, all pages are loaded by ajax and everything is OK. This brings me back to the problem with JS and CSS.

Even original demo "Full Circle Magazine" suffers from the same issue.

@amit777
Copy link

amit777 commented Feb 18, 2019

@tomas-net I'm a little new to pdf2htmlex.. Could you point me to the "pdf2tmlex viewer" you are referring to?

@tomas-net
Copy link
Author

@amit777 By "pdf2tmlex viewer" I mean mainly Javascript code in index.html (or in separate file) used for dynamically loading pages, scrolling to specific page, zooming in/out, etc. and related CSS styles in index.html (or in separate file) used for styling common things like #page-container, backgrounds, outline, etc. (not styles for positioning text from PDF file).

Even original demo propably converted by older version "Full Circle Magazine" (https://pdf2htmlex.github.io/pdf2htmlEX/demo/issue65_en.html) suffers from the same issue.

Can anyone confirm this issue?

stephengaito added a commit that referenced this issue Jun 22, 2020
Update to poppler-0.86.1
findDest now returns stg::unique_ptr and getURI no longer returns GooString but simply std::string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants