Skip to content

PDF Resume

PDF resume is generated from pages located directly in the src/pages/pdf directory. We recommend creating the primary version of the resume in the index.astro file and then create resumes for particular job offers in separate files.

Page structure

The PDF resume is built using the Astro framework. The structure of the page is very similar to the web resume. The only differences are:

  • PDF-specific components and utilities are imported from @/pdf/* unlike the web-specific one you imported from @/web/*.
  • To setup the global context you use the initializePdfContext function instead of initializeWebContext.

Working with PDF resume

When you edit your PDF resume, the best way to preview the changes is to invoke npm run dev and go to the http://localhost:4321/pdf/your-pdf-name address in your browser . The page is rendered with the same width as the final PDF document, so you can see how the content will look like in the generated file.

After you finish editing the content you may want to check, how the PDF paginates the content. To do this, open a second terminal window and run npm run generate:pdf:watch. It will start a watcher generating the PDF files for all templates every time you make an update. Generated files are saved in the public/generated/pdf directory with the same name as their original page file.

Linking the generated PDF

Generated PDF files are saved in the public/generated/pdf directory. To link them in your web resume, specify the pdf.path property of the initializeWebContext configuration.

For example, if you want to link the PDF generated from the src/pages/pdf/index.astro, set the pdf.path to /generated/pdf/index.pdf.