Created
July 20, 2011 17:34
-
-
Save shamun/1095450 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import java.awt.print.PrinterException; | |
import org.apache.pdfbox.pdmodel.PDDocument; | |
import org.apache.pdfbox.pdmodel.PDPage; | |
import org.apache.pdfbox.pdmodel.edit.PDPageContentStream; | |
import org.apache.pdfbox.pdmodel.font.PDType1Font; | |
import org.apache.pdfbox.pdmodel.font.PDFont; | |
import java.io.File; | |
public class print | |
{ | |
public static void main(String args[]) throws Exception | |
{ | |
PDDocument doc = null; | |
try{ | |
File file = new File("c:\\" + args[0]); | |
doc = PDDocument.load(file); | |
doc.silentPrint(); | |
} finally { | |
if (doc != null) | |
{ | |
doc.close(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment