forked from apache/pdfbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PDFBOX-1890: rename tool to better fit its purpose
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1566043 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
|
||
package org.apache.pdfbox; | ||
|
||
import org.apache.pdfbox.cos.COSName; | ||
import org.apache.pdfbox.cos.COSObject; | ||
import org.apache.pdfbox.cos.COSStream; | ||
import org.apache.pdfbox.pdfparser.PDFObjectStreamParser; | ||
|
@@ -32,7 +33,7 @@ | |
* objects. | ||
* @author <a href="[email protected]">Adam Nichols</a> | ||
*/ | ||
public class PdfDecompressor { | ||
public class DecompressObjectstreams { | ||
|
||
/** | ||
* This is a very simple program, so everything is in the main method. | ||
|
@@ -56,7 +57,7 @@ public static void main(String[] args) { | |
PDDocument doc = null; | ||
try { | ||
doc = PDDocument.load(inputFilename); | ||
for(COSObject objStream : doc.getDocument().getObjectsByType("ObjStm")) { | ||
for(COSObject objStream : doc.getDocument().getObjectsByType(COSName.OBJ_STM)) { | ||
COSStream stream = (COSStream)objStream.getObject(); | ||
PDFObjectStreamParser sp = new PDFObjectStreamParser(stream, doc.getDocument()); | ||
sp.parse(); | ||
|
@@ -80,8 +81,8 @@ public static void main(String[] args) { | |
* Explains how to use the program. | ||
*/ | ||
private static void usage() { | ||
System.err.println( "Usage: java -cp /path/to/pdfbox.jar;/path/to/commons-logging-api.jar " | ||
+ "org.apache.pdfbox.PdfDecompressor <input PDF File> [<Output PDF File>]\n" | ||
System.err.println( "Usage: java -cp pdfbox-app-x.y.z.jar " | ||
+ "org.apache.pdfbox.DecompressObjectstreams <input PDF File> [<Output PDF File>]\n" | ||
+ " <input PDF File> The PDF document to decompress\n" | ||
+ " <output PDF File> The output filename (default is to replace .pdf with .unc.pdf)"); | ||
System.exit(1); | ||
|