Skip to content

Instantly share code, notes, and snippets.

@giorgimode
giorgimode / PDFMerger.java
Last active December 14, 2021 06:24
Utility class to merge either multiple pdf files or images and pdfs and make them PDF/A compliant(if provided pdfs are also PDF/A compliant)
import com.google.common.io.Resources;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;