@Test public void testPdfAlphaImageReplacing() throws Exception { InputStream stream = AlterPDFParserTest.class.getResourceAsStream("/test-documents/transp_scanned.pdf"); PDDocument doc = PDDocument.load(stream); PdfContentImagePreprocessor preproc = new PdfContentImagePreprocessor(); boolean hasReplaced = preproc.removeImagesAlphaChannel(doc); assertTrue(hasReplaced); }
public boolean removeImagesAlphaChannel(PDDocument document) { this.document = document; imagesWereChanged = false; try { removeImagesAlphaChannelUnsafe(); return imagesWereChanged; } catch (Exception e) { return false; } }
PdfContentImagePreprocessor { public boolean removeImagesAlphaChannel(PDDocument document) { this.document = document; imagesWereChanged = false; try { removeImagesAlphaChannelUnsafe(); return imagesWereChanged; } catch (Exception e) { return false; } } }
PdfContentImagePreprocessor { public boolean removeImagesAlphaChannel(PDDocument document) { this.document = document; imagesWereChanged = false; try { removeImagesAlphaChannelUnsafe(); return imagesWereChanged; } catch (Exception e) { return false; } }  }
PdfContentImagePreprocessor { public boolean removeImagesAlphaChannel(PDDocument document) { this.document = document; imagesWereChanged = false; try { removeImagesAlphaChannelUnsafe(); return imagesWereChanged; } catch (Exception e) { return false; } }  boolean removeImagesAlphaChannel(PDDocument document); }
PdfContentImagePreprocessor { public boolean removeImagesAlphaChannel(PDDocument document) { this.document = document; imagesWereChanged = false; try { removeImagesAlphaChannelUnsafe(); return imagesWereChanged; } catch (Exception e) { return false; } }  boolean removeImagesAlphaChannel(PDDocument document);  }