Skip to content

Instantly share code, notes, and snippets.

@JoelGeraci-Datalogics
JoelGeraci-Datalogics / MergeFormsRetainingFields.java
Last active August 29, 2015 14:21
Merging PDF Files and Retaining Interactive Fields Using the Datalogics PDF Java Toolkit
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.combine;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.core.types.ASRectangle;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / MergeFormsFlatteningFields.java
Created May 12, 2015 20:51
Merging PDF Files and Flattening Fields Using the Datalogics PDF Java Toolkit
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.combine;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.core.types.ASRectangle;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / CreatePDFPortfolioFromZIP.java
Last active August 29, 2015 14:22
Creating PDF Portfolios from ZIP files using the Datalogics PDF Java Toolkit
package pdfjt.cookbook.combine;
/*
* ****************************************************************************
*
* Copyright 2009-2012 Adobe Systems Incorporated. All Rights Reserved.
* Portions Copyright 2012-2014 Datalogics Incorporated.
*
* NOTICE: Datalogics and Adobe permit you to use, modify, and distribute
* this file in accordance with the terms of the license agreement
* accompanying it. If you have received this file from a source other
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / SignatureWithSeedValues.java
Last active August 29, 2015 14:23
Add Seed Values to PDF Digital Signatures
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.signatures;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.core.types.ASName;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / ReplacePages.java
Last active August 29, 2015 14:24
This sample reproduces the Acrobat feature "Replace Pages". It will change the page content but leave the form fields in place.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.document;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.pdf.document.PDFDocument;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / StampedImage.java
Last active August 29, 2015 14:24
Add an Image to a PDF Page as a Stamp Annotation
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.imaging;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.pdf.document.PDFDocument;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / UsingAcrobatStamps.java
Last active August 29, 2015 14:26
This sample will read a PDF file that contains Stamps looking for one with a specific name and then apply it to a PDF file in the same way that Acrobat does.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.stamps;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.pdf.document.PDFDocument;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / CreateSpreads.java
Created August 3, 2015 20:37
Create spreads from individual PDF pages
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.document;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.core.types.ASCoordinate;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / AddAnnotationsToLayers.java
Created August 5, 2015 20:57
This sample shows how to add content and annotations to a layer on a PDF page. It also shows how to attach JavaScript to the PDF file at the document level.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.document;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.core.types.ASString;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / SetLinkHitArea.java
Created August 18, 2015 23:39
This sample will find all the words on the first page of the document and add links over them. The links will use the quads of the word rather than the rectangular bounding box. This allows for the creation of links that are not parallel to the edges of the page.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.document;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.ByteWriter;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.core.fontset.PDFFontSet;