Hello,
I have an issue where we are converting PDF to TIFF using Aspose.PDF and the resulting TIFF does not contain the barcode images that were on the originating PDF file. I was using version 11.9 but just upgraded to version 17.9 (net35 dll). I don’t care about reading the barcode at all, I just want to have the resulting TIFF file look exactly like the originating PDF.
Here is my original code where horizontal and vertical resolution are both 300 with CompressionType.LZW:
using (var pdfFile = new Document(TempSourceFilePath))
{
Resolution tiffResolution = new Resolution((int)horizontalResolution, (int)verticalResolution);
TiffSettings tiffSettings = new TiffSettings();
switch (format)
{
case TiffFormatType.TiffGroup4:
tiffSettings.Compression = CompressionType.CCITT4;
break;
case TiffFormatType.TiffLzw:
tiffSettings.Compression = CompressionType.LZW;
break;
default:
throw new ArgumentOutOfRangeException("format");
}
//create TIFF device
TiffDevice tiffDevice = new TiffDevice(tiffResolution, tiffSettings);
//convert a whole file and save the image to stream
tiffDevice.Process(pdfFile, stream);
}
I also tried using PDFConverter, but it produced the same result:
int pageCount = pdfFile.Pages.Count;
for (var i = 1; i <= pageCount; i++)
{
var converter = new PdfConverter();
converter.BindPdf(pdfFile);
converter.StartPage = i;
converter.EndPage = i;
converter.DoConvert();
converter.SaveAsTIFF(stream, tiffSettings);
stream.Position = 1;
converter.Close();
converter.Dispose();
}
If I add in any logic regarding BarCodeReader, the reader never returned with anything. But like I said, i don’t want to necessarily read the bardcode data, rather i would just like it to be included on the resulting TIFF file. Can you reproduce this issue or provide me with sample code to achieve the desired results? Sample files are attached.
PDF to TIFF loses barcode - sample files.zip (724.1 KB)
Thanks for your help!