Created Debugging against PDFBox (markdown)

Eliot Jones
2022-01-15 13:13:55 +00:00
parent a3946820af
commit dd5e7d1651

@@ -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