pdfcpu - A PDF processor written in Go.
Package pdfcpu is a simple PDF processing library written in Go supporting encryption. It provides both an API and a CLI. Supported are all versions up to PDF 1.7 (ISO-32000). The N-up command rearranges the pages of a PDF file in order to reduce its page count. This is achieved by rendering the input pages onto a grid which dimensions are defined by the supplied N-up value (2, 3, 4, 6, 8, 9, 12, 16). Supported are various n-Up orientations: rd(right,down)=default, dr(down,right), ld(left,down), dl(down,left) Proper rotation based on involved aspect ratios will be applied during the process.