Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws Exception {
- PDDocument pdf = null;
- try {
- System.out.println("argument:" + args[0]);
- pdf = PDDocument.load(new File(args[0]));
- addOverlay(pdf); //flattens overlay, fields lost.
- pdf.save("output.pdf");
- pdf.close();
- } finally {
- if (pdf != null) {
- pdf.close();
- }
- }
- return;
- }
- private static void mergeOverlay(final PDDocument pdf) throws IOException {
- PDDocument overlayPDF = PDDocument.load(new File("overlay.pdf"));
- Overlay overlay = new Overlay();
- overlay.overlay(overlayPDF, pdf);
- }
Add Comment
Please, Sign In to add comment