Skip to content

Instantly share code, notes, and snippets.

@JoelGeraci-Datalogics
JoelGeraci-Datalogics / FlattenEverythingExceptLinks.java
Created December 7, 2016 01:47
This Gist shows how to exclude specific annotation types from being flattened by the FormFlattener.
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / FillRichTextField.java
Last active November 18, 2016 17:45
Filla a rich text field in a PDF file and then creates it's appearances.
package pdfjt.cookbook.forms;
/*
* Copyright 2016 Datalogics, Inc.
*/
import com.adobe.fontengine.font.Font;
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 / ExtractPagesMatchingSearchTerms.java
Created November 8, 2016 16:55
Searches for a word, highlights it, then extracts all pages that contain that word
/*
* 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.pdf.document.PDFDocument;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / SearchAndRedactUsingRegEx
Created October 23, 2016 22:26
Search and Redact a PDF Using RegEx
/*
* 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.pdf.document.PDFDocument;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / SpeakerNotesToContent.java
Created October 11, 2016 17:24
Converts PDF Note Annotations to Page Content
/*
* Copyright Datalogics, Inc. 2015
*/
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;
import com.adobe.pdfjt.pdf.content.Content;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / LocateArticleThreads.java
Last active September 29, 2016 18:20
This sample locates article threads and outputs their coordinates to the console
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.document;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.pdf.document.PDFCatalogThreads;
import com.adobe.pdfjt.pdf.document.PDFDocument;
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.document;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / UnPortfolio.java
Created July 12, 2016 20:16
This sample removes the Collection dictionary from a PDF Portfolio making it a regular PDF file with attachments.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.document;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.pdfjt.core.types.ASName;
import com.adobe.pdfjt.pdf.document.PDFCatalog;
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.annotations;
import com.adobe.fontengine.font.Font;
import com.adobe.internal.io.ByteReader;
import com.adobe.internal.io.InputStreamByteReader;
import com.adobe.internal.io.LazyRandomAccessFileByteReader;
@JoelGeraci-Datalogics
JoelGeraci-Datalogics / DrawingPolygons.java
Created June 16, 2016 18:09
This sample draws two stars on a PDF Page using two different techniques.
/*
* 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;