latexcgi
latexcgi copied to clipboard
Is it possible to change the default settings of the embedded PDF viewer?
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?
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
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!
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...
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?