LibreOffice headless how to set margins when converting html to pdf - pdf

I'm using soffice to convert email messages (html) to PDF. Is it possible to somehow specify page margins (via css or pdf export options)?

Related

How can we create PDF which will use same font as reference when we merge small PDFs

We are converting HTML to PDF using a puppeteer and merging multiple PDFs into one, But the PDF generated by the puppeteer is too high.
We are thinking that the same embedded font is getting repeated for different pages, can we use the same font as a reference to PDF size will be decreased?
Font displayed in iText RUPS

Header and footer by uploading PDF

I have multiple PDFs for which I want to insert Header and footer to them automatically while taking printout. Please suggest how to proceed.
Header and footer should display in background and body of PDF should not get altered.
A solution for Windows:
You can use CIB pdf brewer, which is available at https://pdfbrewer.cib.de/. It is a free PDF processor.
Just select all PDFs, which should be processed in the file explorer and right click on CIB pdf brewer => convert. Then you can define a profile with a stationery paper (as pdf or png) which should contain your footer and header and all files will be processed according to that profile.
As a post-Action you could also define to print the resulting pdf to a printer directly.

How to merge pages of a PDF document into a single page from command line?

I have an HTML document to be printed in an 80mm paper roll. So, I convert the HTML document to PDF and use the lp command to print it. Problem is: the generated PDF file breaks my document into pages. What I need is to merge PDF pages into a single page which has the height of the HTML document I am converting from

Used PDF BOX to convert PDF (Multiple pages with mixed orientation) to PostScript, but while printing the Auto Oritenation of PDF is Lost

Used PDF BOX to convert PDF (Multiple pages with mixed orientation) to PostScript, but while printing the Auto Oritenation of PDF is Lost.
If I directly Print PDF it prints fine with mixed Orientation, but not with PostScript file
Any Clues how to set Auto Orientation feature to PostScript file using PDFBOX 2

Make wkhtmltopdf to render text instead of curves

When converting html into a PDF with wkhtmltopdf it seems that the text gets rendered to curves with the default options instead of getting a text-based PDF.
As a consequence it's not possible to select the text in the PDF (as it is a bunch of curves ressembling text) as well as having rendering problems (instead of delegating the rendering of the font to the PDF viewer).
Additional info
There's much more context in here:
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2999
Questions
Q1) How can I tell wkhtmltopdf to render the document by placing text instead of converting text to curves?
Q2) How can I ensure that wkhtmltopdf embeds the needed fonts inside the document just in case the destination machine does not have it?