Skip to content

v0.3.13

Compare
Choose a tag to compare
@hhrutter hhrutter released this 30 Nov 15:53
· 293 commits to master since this release
e89570a

Hello, this release is all about PDF generation!

table  json

A new command interprets a JSON structure representing page declarations and renders PDF pages accordingly:

pdfcpu create in.json [in.pdf] out.pdf

in.json
contains a page sequence with content composed of text, images, colored boxes, tables and more.
Each content element follows a box model consisting of margin, border and padding and may define fonts and colors where appropriate. You may also set general page attributes like paper size, background color or your crop box and you may also define your page headers and footers.

in.pdf
if present, existing page content of in.pdf will be modified by appending to it.

out.pdf
is where rendered pages are written to.

textbox

How it works

The way this command is setup allows for repeatedly adding content to a PDF.
This fosters an incremental approach to PDF generation which may be during the design phase or in production.

simplebox   imagebox

Learning

The best documentation for this command is the combination of the content of:

If you are a Go developer you can play around with createFromJSON_test.go by modifying the JSON file and then executing the test which will give you immediate visual feedback by regenerating the corresponding result PDF.

The JSON is self explanatory and I highly recommend working through all the examples!

Many of the examples are multi page PDFs so make sure you don't miss anything!

You will learn about

  • setting up your layout coordinate system
  • absolute vs. anchored positioning
  • inheritance of fonts, margin, border, padding
  • setting up your custom colors
  • setting up your resource dirs for imageBoxes
  • setting up pools for reused boxes, images and text
  • using guides throughout the layout process
  • how to highlight your crop box and content boxes

Note

Although this command allows for the modification of any PDF it works best for PDFs generated by pdfcpu itself.

PDF Forms

Eventually and this release is really the preparation you will be able to create your PDF forms with this command.

To catch a glimpse of this effort have a look at:

and again the corresponding PDF files in pkg/samples/create/

You are welcome to experiment with form generation based on these form element samples but PDF form creation has NOT been released!

🙏 Thanks everybody for submitting issues and PRs 🙏

Thank you for using pdfcpu 💚

Changelog

e89570a Fix OS agnostic fileName resolving
dc0561f Bump version
72e4e71 Relax validation for FontDescriptor Lang
9616d4b Add create cmd
3c08a45 Add Stefan Huber as contributor
92bfd3e Extend relaxed validation for CIDToGIDMap
c3eb4c0 Fix #335, #358
ba9f089 Fix #349
281745f Fix #353
b80c13b Fix #354
64e3df6 Fix #356
5e1ae87 Fix #362
befba81 Fix #366
5a7da1d Fix #371
437ef37 Fix #380, #387
4adf70c Fix #381
0c4c829 Fix #386
af9e334 Fix #388
6509cea Fix #394
8837dd1 Fix io.Reader based encryption #372
ce70c15 Merge branch 'pr/signalwerk/360' into master
16f43aa stamping: Fix OCG reuse
7e1546b validate cmd: wildcard support