We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change PDF Image format

So I'm using Syncfusion Controls for UWP XAML, and I'm trying to insert JPEGs into a PDF I'm creating, but PdfImage seems to always return bitmaps.  Or at least images with bitmap-like file sizes.
Is there any way to ensure the images being inserted are of JPEG size? The images I'm inputting are JPEGs to begin with.
I'd be fine with bitmaps if I wasn't making PDFs of manga (Japanese comic books), i.e. the size per manga right now ranges from 50-150MB.

It's not a working sample, but here's what I'm using right now.
I'd ask about the memory leak but that's probably better fitted for SO.

Thanks in advance.

3 Replies

AS Abirami Selvan Syncfusion Team October 15, 2015 12:37 PM UTC

Hi Evan,
Thank you for contacting Syncfusion support.
We are unable to reproduce the issue getting memory raises when draw the JPEG image into PDF document. We have attached the sample and output document which we have tried to reproduce the issue.
Please refer the following link:
http://www.syncfusion.com/downloads/support/forum/120785/ze/PDFImage-1506640314
Could you please provide us the image and output PDF document which you have reproduced the issue. It will help us to proceed further analysis in this.
Regards,
Abirami.


ES Evan Stoll October 15, 2015 09:18 PM UTC

Well, I refactored some of the methods and the memory leak ended up being the cause. Lesson learned: using statements are your friends.

To be a little more specific, I just created a file as a destination for the PDF, then called

using (Stream s = new FileStream(/*string*/>f.Path, FileMode.OpenOrCreate)) { await Task.Run(() => SaveAsPdf(/*StorageFile*/f, /*Manga*/m)); }

Various other things needed to be moved around, but leaving the FileStream open ended up being the problem.

I guess the memory leak wasn't unrelated at all.



PH Praveenkumar H Syncfusion Team October 16, 2015 11:11 AM UTC

Hi Evan,

We are happy to know that the memory issue fixed in your side.

Please share us documents and screenshots if you face any issues further, we will happy to assist you.

With Regards,
Praveen

Loader.
Live Chat Icon For mobile
Up arrow icon