cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to move from signal modeling to system modeling at the first JMP Aerospace Analytics webinar. Register. June 18, 1 p.m. US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Stu_Dente
Level I

PDF Reports with Logo in header

I am trying to develop a way to control PDF output of report data.  I would like to have formatting control of the header and footer, and the ability to embed a logo.  Any thoughts on how to approach this?

1 REPLY 1
BioAnalysisFL
New Member

Re: PDF Reports with Logo in header

Ah, I just went through this whole thing building multi-page PDF reports in JMP 19, so let me save you the headache I went through.

Straight up: you get some control, but not as much as you'd hope, and it's better to know that going in than to find out the hard way like I did.

For headers and footers, you've got Set Print Headers(left, center, right) and Set Print Footers(...) to match — three little text slots each. They take plain text plus some handy tokens, so "Page &pn; of &pc;" dropped in the right footer slot gives you "Page 1 of 5" and so on. Works great. But here's what got me: they're text only, and you can't set the font size in the script at all — it secretly follows the "Small" font role tucked away in File ▸ Preferences ▸ Fonts. Took me forever to realize that's why my footer wouldn't shrink. And if you try to stack two lines in one slot, watch out — the \!N newline thing the docs mention straight-up didn't work on my JMP 19 build and silently nuked the entire header. No error, just gone.

Page setup itself is actually solid, no complaints there. Set Page Setup(margins(...), scale(n), portrait(0), paper size("Letter")) handles orientation, margins, scaling, all fine. Just remember to tack on Save PDF(path, Show Page Setup(0)) — that little Show Page Setup(0) shuts off the print dialog popup, which you'll really want once you're cranking out a stack of these unattended.

The logo's where it gets annoying. Because the headers and footers are text only, the logo just can't go there — so there's no built-in way to get it on every page. What does work is sticking it in the body of the report as a picture box, and you can bake it right in as base64 so you're not hauling around a separate image file:

Picture Box( New Image( Char To Blob( logoB64, "base64" ), "png" ) )

Park that at the top of your outer V List Box and boom, you've got a letterhead — but page 1 only, 'cause the body just renders wherever it lands.

If you genuinely need that logo on every single page, I'll be honest with you, JMP 19 won't do it on its own. What I ended up doing was a two-step deal: let JMP pump out the PDF, then run a quick little script afterward to stamp the logo on every page — Python with pypdf or reportlab knocks it out in a handful of lines across the whole folder. Not pretty, but it's rock solid, and once it's wired up you forget it's even there.

So the gist of it: JMP 19 is great for the data side and gives you decent text headers/footers and page setup, plus a logo on page 1 — but no per-page images and zero font control from the script. If a logo on every page is a hard line for you, just plan on letting JMP build the PDF and stamping it after, instead of beating your head against the wall trying to force it all inside JMP like I did.

Recommended Articles