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

Is it possible to change the default settings of the embedded PDF viewer? #19

Open
dbitouze opened this issue Nov 27, 2023 · 4 comments

Comments

@dbitouze
Copy link

dbitouze commented Nov 27, 2023

I'd like to change some of the default settings of the integrated PDF viewer, for example the default zoom (from "Auto Zoom" to “Full Width”) or the background color of the PDF page (currently transparent, which is not suitable when a dark mode is used).

Is it possible to change these default settings on the latexcgi side?

@dbitouze dbitouze changed the title Is it possible to change default settings of the embedded PDF viewer? Is it possible to change the default settings of the embedded PDF viewer? Nov 27, 2023
@davidcarlisle
Copy link
Owner

well by default it just does

https://texlive.net/pdfjs/web/viewer.html?file=/latexcgi/document_E367_13155.pdf

so customisation is limited to whatever options PDFjs exposes as URL parameters.

You can set the zoom level there by the look of it

https://github.com/mozilla/pdf.js/wiki/Viewer-options

....#zoom=page-width (untested)

the background color should I think be settable on the iframe if you use a modified runlatex.js, to inject some javascript see

https://stackoverflow.com/a/50549200

@dbitouze
Copy link
Author

well by default it just does

https://texlive.net/pdfjs/web/viewer.html?file=/latexcgi/document_E367_13155.pdf

so customisation is limited to whatever options PDFjs exposes as URL parameters.

You can set the zoom level there by the look of it

https://github.com/mozilla/pdf.js/wiki/Viewer-options

....#zoom=page-width (untested)

OK that does the trick, thanks. But is it possible to set this in runlatex.js? AFAICS, /pdfjs/web/viewer.html appears only in perl/latexcgi.

the background color should I think be settable on the iframe if you use a modified runlatex.js, to inject some javascript see

https://stackoverflow.com/a/50549200

Perfect, thanks!

@davidcarlisle
Copy link
Owner

OK that does the trick, thanks. But is it possible to set this in runlatex.js? AFAICS, /pdfjs/web/viewer.html appears only in perl/latexcgi.

er... I'll think about it...

@dbitouze
Copy link
Author

OK that does the trick, thanks. But is it possible to set this in runlatex.js? AFAICS, /pdfjs/web/viewer.html appears only in perl/latexcgi.

er... I'll think about it...

Obviously, no pressure, but is there any news on the subject?

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

2 participants