Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sat Oct 10, 2015 1:39 am

Hi,

Sorry for the inconvenience caused by the issue again. We have put the issue raised to the highest priority. Our dev team is working on it. We will do our best to solve it soon.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Sat Oct 10, 2015 3:23 am

Hi MatthewPierce,

For your issue, please change ImageFormat in this code : Image[] img = SplitImages(image, ImageFormat.Png); as Tiff, in this case, the size of output PDF is about 2MB.
In your original pdf file, the images are stored by Device Gray, and when converting to tiff images, the images are stored by RGB, then converting such images to new PDF file, so the new pdf file is greater than original pdf file.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Tue Nov 07, 2017 11:29 am

Hi,

I am using the paid version of Spire.PDF, and I also have an issue with file sizes.

4 x JPG of 1.5 MB when added to 4 pages of PDF, results in a file of 15 MB.

How can this be avoided - any solutions?

pedgaard
 
Posts: 24
Joined: Fri May 20, 2016 3:12 pm

Wed Nov 08, 2017 7:15 am

Hello,

Thanks for your post. Please use PdfJpegImage to load the jpg image instead of PdfImage. Below is the code snippet for your reference.
Code: Select all
            PdfDocument doc = new PdfDocument();
            PdfPageBase page = doc.Pages.Add();
            //Draw the image
            PdfJpegImage image = new PdfJpegImage(File.OpenRead(@"sample.jpg"));
            //Set smaller size
            float width = image.Width * 0.24f;
            float height = image.Height * 0.24f;
            float x = (page.Canvas.ClientSize.Width - width) / 2;
            page.Canvas.DrawImage(image, x, 0, width, height);
            doc.SaveToFile("result.pdf");


Best Regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Fri Nov 10, 2017 8:54 am

Hello pedgaard,

Greetings from E-iceblue!
Has your issue been resolved?
Your feedback will be greatly appreciated.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Sun Nov 12, 2017 6:26 pm

Jane.Bai wrote:Hello pedgaard,

Greetings from E-iceblue!
Has your issue been resolved?
Your feedback will be greatly appreciated.

Sincerely,
Jane
E-iceblue support team


Thanks, I can confirm it works as expected now. This seems to work efficiently.

pedgaard
 
Posts: 24
Joined: Fri May 20, 2016 3:12 pm

Mon Nov 13, 2017 1:05 am

Hi pedgaard,

Thanks for your feedback.
Please feel free to contact us if you need any assistance.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Jan 08, 2021 8:52 am

Hello JORGEMAL,

Sorry for the long silence.
Your issue that the generated PDF file size was very large has been solved.
Welcome to download and test Spire.PDF Pack Version:7.1.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.PDF/7.1.0

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF