I have another issue with PDF to TIF conversion. See attached file.
My code:
PdfConverter pdfDoc = new PdfConverter();
Aspose.Pdf.Devices.Resolution res = new Aspose.Pdf.Devices.Resolution(204, 196); //fine by default
if (this._OutputResolution == OutputResolutions.Normal)
{
res = new Resolution(204, 98);
}
pdfDoc.Resolution = res;
pdfDoc.BindPdf(input);
//bool landspace = pdfDoc.Document.PageInfo.IsLandscape;
//check for landspace and auto rotate
for (int i = 0; i < pdfDoc.Document.Pages.Count; i++)
{
Aspose.Pdf.Rectangle rect = pdfDoc.Document.Pages[i + 1].GetPageRect(true);
//if (pdfDoc.Document.Pages[i + 1].PageInfo.Height < pdfDoc.Document.Pages[i + 1].PageInfo.Width)
//if (pdfDoc.Document.Pages[i + 1].Rect.Height < pdfDoc.Document.Pages[i + 1].Rect.Width)
if (rect.Height < rect.Width)
{
pdfDoc.Document.Pages[i + 1].Rotate = Aspose.Pdf.Rotation.on90;
}
}
pdfDoc.DoConvert();
Aspose.Pdf.Devices.TiffSettings tiffSettings = new Aspose.Pdf.Devices.TiffSettings();
//tiffSettings.Depth = Aspose.Pdf.Devices.ColorDepth.Default;
//tiffSettings.Brightness = 1;
if (this._TIFEncodingMode == TIFEncodingModes.CCITT3)
{
tiffSettings.Compression = CompressionType.CCITT3;
}
else if (this._TIFEncodingMode == TIFEncodingModes.CCITT4)
{
tiffSettings.Compression = Aspose.Pdf.Devices.CompressionType.CCITT4;
}
switch (PageType)
{
case PageTypes.Letter:
pdfDoc.SaveAsTIFF(outputFileName,Aspose.Pdf.PageSize.PageLetter, tiffSettings);//, Aspose.Pdf.PageSize.A4);
break;
case PageTypes.Legal:
pdfDoc.SaveAsTIFF(outputFileName,Aspose.Pdf.PageSize.PageLegal, tiffSettings);//, Aspose.Pdf.PageSize.A4);
break;
case PageTypes.A4:
pdfDoc.SaveAsTIFF(outputFileName,Aspose.Pdf.PageSize.A4, tiffSettings);//, Aspose.Pdf.PageSize.A4);
break;
default:
pdfDoc.SaveAsTIFF(outputFileName,Aspose.Pdf.PageSize.A4, tiffSettings);//, Aspose.Pdf.PageSize.A4);
break;
}
pdfDoc.Dispose();