TIFF to PDF convert - PDF filesize getting over 3 times as big

Hi, im trying to convert the attached TIFF to PDF using the following code:

Dim pdf1 As Pdf = New Pdf()
Dim sec As Section = pdf1.Sections.Add()

Dim ms As MemoryStream = New MemoryStream()
Dim myimage As New Bitmap(ms)

Dim imageht As Aspose.Pdf.Generator.Image = New Aspose.Pdf.Generator.Image(sec)
imageht.ImageInfo.ImageFileType = ImageFileType.Tiff
imageht.ImageInfo.ImageStream = ms
imageht.ImageInfo.IsBlackWhite = false
sec.Paragraphs.Add(imageht)

Dim tifstream = New MemoryStream()
pdf1.Save(tifstream)



The tif size is 285 kb
The converted PDF file is 954kb

When I set the “IsBlackWhite” to “true”, the PDF filesize drops to 300kb.
But im not intererested in converting the tiff to BlackWhite.

How can I convert the TIFF to PDF without the filesize getting much bigger?

Hi Thomas,

Thanks for your inquiry. While testing the scenario with your shared document, we have managed to reproduce the issue with latest version of Aspose.Pdf for .NET 9.6.0. We have logged a ticket PDFNEWNET-37588 in our issue tracking system for further investigation and resolution. We will notify you as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

Hi again,
How soon can I expect an answer/possible solution to this problem? Its important for our customers that the filesize does not get 3 times as big when they convert all of their TIFFs into PDFs.

Hi Thomas,


Thanks for your inquiry. I am afraid your issue is not resolved as we have noticed it recently. It is pending for investigation in the queue with other priority task. As soon as its investigation is completed then we will share our findings or ETA with you.<o:p></o:p>

We are sorry for the inconvenience caused.<o:p></o:p>

Best Regards,

Hi again,
I know I have been asked about this before, but our customers are asking me for a deadline to solve this problem - therefore I have to ask you guys to provide me with a deadline or some more information about when this will be resolved. Are we talking about weeks, months, years? :slight_smile:

Hope you can provide me with more information

Hi Thomas,


Thanks for your inquiry. I am afraid your reported issue is still not investigated due to other priority issues. However we have recorded your concern and requested our development team to complete its investigation at their earliest and share an ETA. We will update you as soon as we get a feedback.

Thanks for your patience and cooperation.

Best Regards,

Hi Thomas,


Thanks for your patience.

The development team has further investigated the issue reported earlier and as per our current estimates, we plan to get earlier reported issue resolved in Aspose.Pdf for .NET 10.0.0 which is expected to release in January-2015. Please be patient and wait for the resolution.

The issues you have found earlier (filed as PDFNEWNET-37588) have been fixed in Aspose.Pdf for .NET 10.0.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hello again,
I have just tested the new version (10.0.0.0) of the Aspose.PDF DLL.

But there is not difference - using my previous example the resulting PDF is still 954kb (TIF size was 285kb)

We have just renewed our license and one of the reason for this was due to this fix (which does not work?)

Please provide me with an example howto convert TIF to PDF as my example apparently isnt doing the job.

Hi Thomas,


Thanks for your inquiry. Please fine sample code sample as following. But I am afraid your above reported issue is not fixed completely in Aspose.Pdf for .NET 10.0.0. Output PDF file size is fixed but an additional evaluation mark is being added into output PDF file. We are in coordination with our development team and will fix the issue completely as soon as possible.

We are truly sorry for the inconvenience.

string outFile = myDir + “ImagetoPDFDOM1.pdf”;<o:p></o:p>

string inFile = myDir + "TestTif.tif";

Document doc = new Document();

Page page = doc.Pages.Add();

// Set margins so image will fit, etc.

page.PageInfo.Margin.Bottom = 0;

page.PageInfo.Margin.Top = 0;

page.PageInfo.Margin.Left = 0;

page.PageInfo.Margin.Right = 0;

page.PageInfo.Height = Aspose.Pdf.PageSize.A4.Height;

page.PageInfo.Width = Aspose.Pdf.PageSize.A4.Width;

//Create an image object

Aspose.Pdf.Image image = new Aspose.Pdf.Image();

image.IsBlackWhite = true;

//Add the image into paragraphs collection of the section

page.Paragraphs.Add(image);

image.File = inFile;

doc.Save(outFile);


Best Regards,

Hi again,
Im not sure whether or not you have read my original post:

When I set the “IsBlackWhite” to “true”, the PDF filesize drops to 300kb.
But im not intererested in converting the tiff to BlackWhite.


Therefore it is not an acceptable solution to tell me to set “IsBlackWhite” to true.
I was assuming the “fix” being released in version 10.0.0.0 would be something else, otherwise nothing has changed.

Can you provide me with another solution to the problem?

Regards,
Thomas

THTHO:
Im not sure whether or not you have read my original post:

When I set the “IsBlackWhite” to “true”, the PDF filesize drops to 300kb.
But im not intererested in converting the tiff to BlackWhite.


Therefore it is not an acceptable solution to tell me to set “IsBlackWhite” to true.
I was assuming the “fix” being released in version 10.0.0.0 would be something else, otherwise nothing has changed.

Can you provide me with another solution to the problem?
Hi Thomas,

Thanks for the acknowledgement.

I have re-opened earlier resolved PDFNEWNET-37588 and have shared your concerns with development team. They will further look into this problem and we will keep you posted on the status of correction.

Hi again,
I have not recieved any info about a new update.
As stated earlier we renewed our license purely because of the 10.0.0.0 update where the problem would be fixed and we have promised our customers that this would be implemented this january.

Is there anything I can do to help or how soon can I expect a fix?

Hi Thomas,


Thanks for your patience.

We have further discussed the issue PDFNEWNET-37588 with development team and I am afraid we can not reduce PDF size with full colors, because tiff uses black white color codec (please check CompressionCCITT). Therefore in order to reduce the size of resultant PDF, please try using image1.IsBlackWhite = true;

PS, I have also observed that source/input TIFF image is black&white, so you can use IsBlackWhite property to generate optimized output.