The attached Releases.pdf is the inputfile for this piece of code: (I selected “2U” in the ListBoxFormat):
// open input Pdf
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(inputPath);
// Convert to different PDF compliant document
// During conversion process, the validation is also performed
PdfFormat myPdfFormat;
if (Enum.TryParse(listBoxFormat.SelectedItem.ToString(), out myPdfFormat))
{
uint value = (uint)myPdfFormat;
}
else { /* error: the string was not an enum member */ }
string logFile = Path.GetFileNameWithoutExtension(inputPath) + "-log.xml";
pdfDocument.Convert(Path.Combine(_outDir, logFile), myPdfFormat, ConvertErrorAction.Delete);
// Save output document
pdfDocument.Save(outputPath);
But it fails with: “Not supported image type”. How to fix this?
Releases.zip (2.0 MB)
Releases-log.zip (669 Bytes)