Remix.run Logo
▲ tacostakohashi 8 hours ago

I've periodically struggled with an HTML resume that can be converted to a PDF using chrome headless / puppeteer wkhtmltopdf, and looks good both on screen and PDF/printed.

Admittedly I'm not an HTML/css guru, but I know a bit... and it really feels like it shouldn't be this hard / require so many tricks to get it working even half ok.

The biggest issue is that the pages kind of fight against the DOM structure of the HTML. Like lets say I have big:

<div> <h2>Experience<h2>

  <div> <h3> Job A </h3> <p>Description</p>

  <div> <h3> Job B </h3> <p>Description</p>

  <div> <h3> Job C </h3> <p>Description</p>

  <div> <h3> Job D </h3> <p>Description</p>
</div>

There isn't really a good way to say...

* Keep "Experience" and "Job A" on the same page.

* Don't break after Job X / before Description.

* Don't try to keep the whole toplevel div on one page by breaking before, just break within it, sensibly.

Whatever tweaks/hints/hacks one applies to achieve that tend to be pretty brittle across browsers/page sizes/etc.

It's very tempting to just give up and go back to... something actually page-centric like word, pagemaker or whatever, instead of HTML and then having print as a second class citizen.

▲Rygian 8 hours ago | parent | next [-]

Have you looked into the CSS paged media directives?.

https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Page...

▲alDuncanson 7 hours ago | parent | prev | next [-]

I was dealing with something similar and ended up writing my resume in markdown and converting the markdown to html, pdf, and png (with tools like pandoc and tectoni) in CI with a custom GitHub action I wrote: https://github.com/alDuncanson/md-press

▲INTPenis 8 hours ago | parent | prev [-]

Oh man, we are kindred spirits.

I also feel like there's no point in making a CV in HTML for my website, if I'm going to re-make it in PDF for all the old school application processes out there.

My solution was simply to keep the online CV as simple as possible, so it still looked good in PDF. But it's far from perfect.

▲beej71 8 hours ago | parent | next [-]

I wrote two xsl stylesheets and then encoded my resume in xml.

I know what you're thinking: "Ok genxer", but hear me out. :)

The two stylesheets produce HTML and Typst code. And so I get the exact render that I want.

(It actually goes further, making a CV and a resume from the same xml source, rearranging sections and sorting appropriately.)

Xml and xsl are quite dated, but this really does seem to be a good use case for data/presentation separation.

But really my dream is for print css (or something) to finally be implemented.

▲mxuribe 7 hours ago | parent [-]

I remember leveraging xml and xslt for doing the exact thing for my resume! This was quite some time ago, when xml was king. So, as a way to both unify my generation for my resume but more importantly learn more about xml, xslt, i created what sounds like a similar pipeline to yours. It felt really cool, and i learned about xslt - which to this day i'm impressed by. But, over the years as xml, xslt seem to have waned, plus i never got to use such skills at any of my jobs, and finally employers just wanted a Word doc, not a PDF...then i just stopped using my setup. Nowadays i simply keep a local copy of an .ODT file, and export to word or PDF, or whatever format an employer or recruiter asks for...and like 99.999% of the time its a Word doc. But, back then, it certainly as fun learning that stuff!

▲etcetcetcetceta 7 hours ago | parent | prev [-]

I think you can generate html from latex, I use latex for my CV and render it as a pdf for circulation.