Skip to content

Instantly share code, notes, and snippets.

@JoelGeraci-Datalogics
JoelGeraci-Datalogics / Quadrilaterals.java
Created June 2, 2016 17:38
This sample locates words and adds Polygon annotations over the word quads.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.document;
import com.adobe.fontengine.font.Font;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.core.types.ASName;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / ReplaceImage.java
Last active June 10, 2016 18:49
This sample replaces one image in a PDF file with a new one.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.imaging;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.pdf.document.PDFDocument;
import com.adobe.pdfjt.pdf.document.PDFOpenOptions;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / SaveIncremental.java
Last active June 10, 2016 18:51
Saves a file using various settings
/*
* 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 / FillCertifiedForm.java
Last active June 10, 2016 18:52
This sample will populate a few fields on a Certified Document and the save it without breaking the certification.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.forms;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / StaticXFA2AcroForm.java
Last active October 16, 2020 00:42
This Gist will convert a Static XFA Form to an AcroForm by removing the XFA dictionary.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.forms;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / InsertRichMediaAnnotation_StreamingVideo.java
Created March 5, 2016 16:53
Creates a new PDF with a Rich Media Annotation on the first page that plays a streaming video.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.annotations.richmedia;
import com.adobe.internal.io.LazyRandomAccessFileByteReader;
import com.adobe.pdfjt.core.types.ASName;
import com.adobe.pdfjt.core.types.ASRectangle;
import com.adobe.pdfjt.core.types.ASString;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / InsertRichMediaAnnotation_Video.java
Last active March 2, 2016 15:40
Creates a new PDF with a 3D Annotation on the first page
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.annotations.richmedia;
import com.adobe.internal.io.LazyRandomAccessFileByteReader;
import com.adobe.pdfjt.core.types.ASName;
import com.adobe.pdfjt.core.types.ASRectangle;
import com.adobe.pdfjt.core.types.ASString;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / InsertRichMediaAnnotation_U3D_Advanced.java
Last active August 9, 2022 19:46
Creates a new PDF with a 3D Annotation, in this sample a U3D file is used.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.annotations.richmedia;
import com.adobe.internal.io.LazyRandomAccessFileByteReader;
import com.adobe.pdfjt.core.cos.CosCloneMgr;
import com.adobe.pdfjt.core.cos.CosObject;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / InsertRichMediaAnnotation_U3D.java
Created January 25, 2016 18:28
Inserts a 3D model in a PDF page using the Rich Media Annotation.
/*
* Copyright Datalogics, Inc. 2016
*/
package pdfjt.cookbook.annotations.richmedia;
import com.adobe.internal.io.LazyRandomAccessFileByteReader;
import com.adobe.pdfjt.core.types.ASName;
import com.adobe.pdfjt.core.types.ASRectangle;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / FindAndRemoveWatermarks.java
Last active July 27, 2021 17:08
Finds and removes Watermarks and Backgrounds from all pages in a PDF document
/*
* 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.cos.CosDictionary;