I would like to modify the pdf created from a page served by a GitLab wiki server.
An example is this page: https://develop.openfoam.com/Development/openfoam/-/wikis/home. I would like to do this for pages served by our internal GitLab server. I would like to hide e.g. the line with the last commiter at the top of the page.
I tried e.g. the following css files:
body {
display: none !important;
}
or
.wiki-last-edit-by {
display: none !important;
}
I tried the command line option --css (-c) using a locally stored css file, but this seems to have no effect. I guess the css file needs to be served by the same server as the web page?!? If I understand the code here correct, the link to the css file is injected into the downloaded html page before rendering it and I guess, that electron does not like to have a css file from a different server?
Or does the whole command line option only work, if local mark down files are printed? The README file in not clear about it? It says:
In the headline
To generate a PDF from a Markdown file with custom CSS (defaults to Github markdown style)
But the example uses an html-file:
electron-pdf index.html ~/Desktop/index.pdf -c my-awesome-css.css
Should css injection work for downloaded pages?
If not, would it be possible to add some javascript code to the electron-pdf/lib/preload.js to inject css after the page has be downloaded, but before it is printed? E.g. following this example: https://stackoverflow.com/questions/42930572/inject-css-into-webview-chrome-electron-html-css-js
Unfortunately, it is not possible to modify the css used by the GitLab wiki server (https://gitlab.com/gitlab-org/gitlab/-/issues/201890).
I would like to modify the pdf created from a page served by a GitLab wiki server.
An example is this page: https://develop.openfoam.com/Development/openfoam/-/wikis/home. I would like to do this for pages served by our internal GitLab server. I would like to hide e.g. the line with the last commiter at the top of the page.
I tried e.g. the following css files:
or
I tried the command line option --css (-c) using a locally stored css file, but this seems to have no effect. I guess the css file needs to be served by the same server as the web page?!? If I understand the code here correct, the link to the css file is injected into the downloaded html page before rendering it and I guess, that electron does not like to have a css file from a different server?
Or does the whole command line option only work, if local mark down files are printed? The README file in not clear about it? It says:
In the headline
But the example uses an html-file:
Should css injection work for downloaded pages?
If not, would it be possible to add some javascript code to the
electron-pdf/lib/preload.jsto inject css after the page has be downloaded, but before it is printed? E.g. following this example: https://stackoverflow.com/questions/42930572/inject-css-into-webview-chrome-electron-html-css-jsUnfortunately, it is not possible to modify the css used by the GitLab wiki server (https://gitlab.com/gitlab-org/gitlab/-/issues/201890).