How to pre-set the font so that a PDF file will not be outside the margins

I can open pdf files and then work with them fine but there is always a problem that the text of each line extends too far - it’s clear that it’s due to too large a “default” font.

How can I make pdf files look nicer right away when I open them so that I don’t have to manually reformat them? I guess I’ll just try shrinking the font on each page for now but even this is tedious. I have to do each page and I have to guess which font will work.

Is there a feature in LibreOffice that would look at the pdf file and then calculate the correct font ahead of time? Or can I fake this somehow?

If you have the same fonts installed as in the PDF then the text should remain the same length.
You can check what fonts are used in a PDF in Adobe Reader by clicking File > Properties > Fonts. If you don’t have the same fonts, if you find a similar font with the similar metrics you can use the replacement table. For a simple example, if you don’t have Calibri you can use a free font Carlito instead.
The replacement table is in Tools > Options > LibreOffice > Fonts, tick the box, *Use replacement table and add the font and its substitute. The next time you come across this font LibreOffice will make the substitute for you. The Help button will lead to some more detail.

Ah yes, good point EarnestAI - earlier, I noticed that I simply have NOT installed many fonts onto this particularly Linux machine which is kind of old and weird - it’s not the sudo install type of machine.

So tomorrow or tonight, I’ll just hop over to my Windows machine, zip up the fonts, and then drop them into my user share for fonts.

I remember a while back, I DID install a couple more fonts on the Linux machine so it’s getting better.

But good point - I’m missing fonts - I’ll check the File Properties in Adobe Reader. Sometimes I can see them when I highlight them too. I had some sort of CharlesModern font mapping to a DejaVu Serif which might not work.

Thanks for the heads up.

In fact, my document has CharlesModern(TT not embedded), CharlesModern-Bold(TT not embedded), CharlesModern-Italic(TT no embedded), Courier Standard(Type 1 not embedded), Helvetica(Type 1 not embedded), ZapfDingbats(Type 1 not embedded), AdobePiStd(Type 1C CID embedded subset), and CharlesModern-Bold(TT CID embedded subset).

So perhaps the above are mostly Windows.

Yes. Writer can do this, but only when a pdf is created by writer. And as the idea of pdf was to preserve a format across very different computers it is NOT designed to be fitted afterwards. There is html and epub for this.

I’ve tried setting the default font before opening the document but it doesn’t work.

I found a link that I will try - it mentions a user-invented script as well as Calibre and some other tools - sounds like some of this might work - I’ll give it a try

I tried the script but I get an error:
mv: Cannot stat some sort of png picture file in Pictures - perhaps I need to download some stuff from his Github directory. It’s not a self-contained program since it’s a script.

I also need to check the prereqs: awk bash coreutils dc file ghostscript imagemagick sed zip

Forget the script for your task. I didn’t try, but read the thread. It will not convert a pdf to text, wich can be edited.

It uses ghostscript to generate a series of pictures of pages and then uses this pictures as background pictures for an empty .odt-file.

So you have either a complicated viewer for pdf or a starting point to manually type in and recreate the document on top of the backdrop.

As already recommended by @EarnestAl : Install the right fonts and the pdf should work. But it will be designed for the creators need, not necessarily yours.

There is a package of fonts from Windows licensed for free use on linux. Check out the following link for installation, even if this may not your weird “non sudo” linux. (I feel quite old, writing this…):

(Bur the list of fonts you cited sounds more like adobe, than Microsoft.)