We recently ran into an issue trying to convert a color pdf file to greyscale. The resulting file when opened in adobe is corrupted, but what is shown still has some resulting color in it.
String fileName = "APCO+Flyer+2018.pdf";
String finalPdfName = fileName.replace(".pdf", "_grey.pdf");
RgbToDeviceGrayConversionStrategy strategy = new RgbToDeviceGrayConversionStrategy();
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(fileName);
for (int idxPage = 1; idxPage <= pdfDocument.getPages().size(); idxPage++) {
Page page = pdfDocument.getPages().get_Item(idxPage);
strategy.convert(page);
}
pdfDocument.save(finalPdfName);
APCO Flyer 2018.zip (105.5 KB)