davidcarlisle / latexcgi

LaTeX server via perl cgi script, developed for learnlatex.org
https://davidcarlisle.github.io/latexcgi/
MIT License
32 stars 3 forks source link

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

Open dbitouze opened 10 months ago

dbitouze commented 10 months ago

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?

davidcarlisle commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 9 months ago

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?