Skip to content

Instantly share code, notes, and snippets.

@w33ble
Last active June 8, 2023 12:16
Show Gist options
  • Select an option

  • Save w33ble/38c5e0220d491148de1c to your computer and use it in GitHub Desktop.

Select an option

Save w33ble/38c5e0220d491148de1c to your computer and use it in GitHub Desktop.
option description default
header
footer
content
defaultStyle { fontSize: 12, font: 'Roboto' }
pageBreakBefore
styles
background
images
watermark
@ThibaultJanBeyer
Copy link

Nice, thanks! This helped me a lot

@alphanumeric0101
Copy link

jee whiz, this was clutch thank you! can't believe this isn't mentioned in the documentation. if you want to simply print to fs then the examples folder is ok but if you want dataURI or Base64 it's like what the heck do I do as the getBase64() method doesn't exist.

@mostlyharmless2024
Copy link

epic resource, thanks a ton!

FYI - "retrun" on line 13 of the first code example

@szz-dvl
Copy link

szz-dvl commented Jan 19, 2019

Hi; I'm trying to use this to pipe the document through an express response object, however if I don't write the document first (using the deprecated function pdfDoc.write) the document is not properly generated. If anyone have an idea it will be welcome.

Thanks in advance.

Szz.

@szz-dvl
Copy link

szz-dvl commented Jan 19, 2019

Hey it is solved now, forgot to call doc.end() sorry for the inconvenience!

Thanks again.

Szz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment