mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
Created Debugging against PDFBox (markdown)
23
Debugging-against-PDFBox.md
Normal file
23
Debugging-against-PDFBox.md
Normal file
@@ -0,0 +1,23 @@
|
||||
If you need to debug and compare content stream processing or other file content processing against PDFBox you can clone PDFBox locally and set the following `main` method to launch in the IntelliJ debugger once you have changed the file path to one you want to use locally:
|
||||
|
||||
https://github.com/apache/pdfbox/blob/trunk/examples/src/main/java/org/apache/pdfbox/examples/rendering/CustomGraphicsStreamEngine.java#L57
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
public static void main(String[] args) throws IOException
|
||||
{
|
||||
File file = new File("C:\\temp\\pdfs\\", "document with error.pdf");
|
||||
|
||||
try (PDDocument doc = Loader.loadPDF(file))
|
||||
{
|
||||
PDPage page = doc.getPage(0);
|
||||
CustomGraphicsStreamEngine engine = new CustomGraphicsStreamEngine(page);
|
||||
engine.run();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You will need to install Maven and do a clean install before opening/using the code in Intellij:
|
||||
|
||||
https://github.com/apache/pdfbox#build
|
||||
Reference in New Issue
Block a user