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
close icon

Problem while exporting pdf to image

Dear Sir

I am facing a problem when converting pdf to image.  
1.)The letter 'y' is missing in newly saved image i.e abc.png. if you see in the image  "Qty" is showing only "Qt" and "your" is "our".  I am attaching the pdf file. Please check this issue. 
2.)Also the image when printed on paper  then it is showing very light color while pdf is very well visible.

The code is as below:-
         
            PdfLoadedDocument loadedDocument = new PdfLoadedDocument("D:/websites/demo/print/p.pdf");         
            PdfPageBase page = loadedDocument.Pages[0];            
            //string extractedTexts = page.ExtractText(true);

            float h = page.Size.Height;
            float w = page.Size.Width;
            float r = h / w;

            float SavedWidth =(float ) 2.2 * 300;
            h = SavedWidth * r;
            Bitmap [] _img = loadedDocument.ExportAsImage(0, 0);
            _img[0].Save("D:/websites/demo/print/abc.png");       

Looking for the response.

Regards
Manu Sharma

Attachment: p_61889d6d.zip

3 Replies

RT Ramya Thirugnanam Syncfusion Team June 20, 2019 10:48 AM UTC

Hi Manu, 
 
Query 
Response 
The letter 'y' is missing in newly saved image i.e abc.png. if you see in the image  "Qty" is showing only "Qt" and "your" is "our".  I am attaching the pdf file. Please check this issue.  
We are unable to reproduce the reported issue with the provided details in the latest Essential Studio Version 17.1.0.52. Can you please share us the Essential Studio Version in which you are facing the issue?. These will be helpful for us to investigate further. 
 
However we can export the PDF document pages as raster images using the Syncfusion EJ2 PDF Viewer. Please find the UG link for the same. 
 
We have created the sample for the same and shared in the following location, 
 
 
Also the image when printed on paper  then it is showing very light color while pdf is very well visible. 
 
We are unable to reproduce the reported issue while printing the exported image in Physical printer. We have printed both original document(orignal.jpg) and the exported image(exported image.jpg) using physical printer and shared the photo of the output in the below location, 
 
Can you please provide you printer details and how you are printing the image, also confirm us whether you are printing the image from the paint. These will be helpful for us to investigate further and assist you better. 
 
 
 
Regards, 
Ramya T 



MA Manu June 20, 2019 12:18 PM UTC

Dear Sir

Thank you for your response.
I am using syncfusion version 15.1400.0.41. with .NET framework 4.0
I am attaching PDF and exported image both. You can see the difference in both. Even before printing fonts are light colored in the image as compared to PDF.

And code is :-
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PdfLoadedDocument loadedDocument = new PdfLoadedDocument("D:/websites/demo/print/p.pdf");         
            PdfPageBase page = loadedDocument.Pages[0];                
            float h = page.Size.Height;
            float w = page.Size.Width;
            float r = h / w;
            float SavedWidth =(float ) 2.26 *96;
            h = SavedWidth * r;
            var TempSize = new SizeF(SavedWidth, h);        
            Bitmap [] _img = loadedDocument.ExportAsImage(0, 0, TempSize,200, 200,true);
            _img[0].Save("D:/websites/demo/print/abc.bmp");             
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

After converting PDF file to image (.bmp) , printing it using EPSON  thermal printer with configuration:-
Portable receipt printer
Print method: Thermal line printing 
Width (mm): 57.5 ± 0.5 mm 

Thanks & Regards
Manu


Attachment: Print_dd3f4f5b.zip


RT Ramya Thirugnanam Syncfusion Team June 21, 2019 05:38 PM UTC

Hi Manu, 
 
Thank you for your update. 
 
We have improved the rendering quality in our latest version, so could please upgrade to our latest version to resolve rendering issue. 
 
However we can export the PDF document pages as raster images using the Syncfusion EJ2 PDF Viewer. Please find the UG link for the same.  
  
We have created the sample for the same and shared in the following location,  
 
Regards, 
Ramya T 


Loader.
Live Chat Icon For mobile
Up arrow icon