I just tried the code out, and I can read in DOCX files and output them to PDF/TIFF/JPEG without issue. But when I read in a PDF file, and try to output DOCX/TIFF/JPEG, only the DOCX file works. The TIFF and JPEG files are corrupted and cannot be opened. Is there a glitch in the demo, or am I missing something? Thankyou in advance.
Hello Paul,
Thanks for the prompt reply. I have tried it with two PDFs, both have the same results. Both are attached.
Hi Paul,
days temporary license to evaluate our product without
any limitation. Hopefully your issue will be resolved.
TIF Image
var savePdfDocument = new Aspose.Pdf.Document(myDir + "SomeLayout.pdf");
var resolution = new Resolution(300);
var tiffSettings = new TiffSettings
{
Compression = CompressionType.LZW,
//Depth = Aspose.Pdf.Devices.ColorDepth.Format8bpp,
Shape = ShapeType.None,
SkipBlankPages = true
};
var tiffDevice = new TiffDevice(resolution, tiffSettings);
var saveName = myDir + "SomeLayout" + ".tif";
tiffDevice.Process(savePdfDocument, saveName);
JPEG Image
var pdfDocument = new Document(myDir + "SomeLayout.pdf");
for (int pageCount = 1; pageCount <= pdfDocument.Pages.Count; pageCount++)
{
using (FileStream imageStream = new FileStream(myDir + string.Format("{0}_page{1}.jpg", "Output", pageCount), FileMode.Create))
{
var resolution = new Resolution(300);
var jpegDevice = new JpegDevice(resolution);
//convert a particular page and save the image to stream
jpegDevice.Process(pdfDocument.Pages[pageCount], imageStream);
//close stream
imageStream.Close();
}
}
Please feel free to contact us for any further assistance.
Best Regards,