I’m trying to send a PDF through an API for a work process, and the fonts and page breaks need to stay exactly as they are. Is that possible?
Honestly yes, that’s totally doable. A PDF is just a file, so if you send it as-is (binary or base64 in the request) nothing inside it changes. Formatting only breaks when something re-renders or re-saves it, like printing to PDF again. I send plotted drawing sets through automated stuff all the time and they arrive identical.
When we set up automated forms at our clinic, I had the exact same worry. As long as you send the actual file as raw binary or base64 (which just turns the file into safe text), the formatting will not change at all. We use PDFcap to process ours without losing fonts or layout.
Sending a PDF via an API is just moving a file, so encode it in base64 to keep your fonts and page breaks intact. I learned this the hard way when my automated bakery invoices turned into unreadable gibberish. Avoid trying to extract the text before sending, because that will immediately strip all your careful formatting.
Had the same thing last month trying to push reports through an API. As long as you’re sending the actual PDF file (not converting it to text or HTML first), the formatting, fonts and page breaks stay intact since they’re baked into the file itself. The issue only comes up if something in the pipeline re-renders it. Worth testing with a small file first, learned that the hard way after a big batch came through weird.
@finlay.wilson That matches what I saw with our month-end reports, raw binary or base64 keeps everything baked in. Only thing I’d add is don’t let anything in the pipeline “print to PDF” it again, that’s where my old laptop mangled the fonts once.