print pdf with background image ...

Using PdfViewer control in my Winform application, I can successfully display a pdf contetnt with background image in the pdfviewer control.

But, when I print using the pdfviewer control's toolbar's print button (or with the print() method call of the control in code), the output does not contain the background image!!

How to solve it, or what do I miss?



4 Replies

GR grchen August 11, 2021 03:47 AM UTC

Add more info:  the pdf is converted from a html string that has <body> tag with datauri image (that is, "<body

style='background:url(data:image/jpeg;base64,b64stringhere) top left repeat; opacity: 50;' ....>").

And the generated pdf (along with the background image) can be correctly display with the pdfviewer control.

Problem occurs in printing the pdf either to paper or to file, that the background image is not appeared in the printed output.


The code to print simply is :

 

PdfViewerControl pdfviewer;

pdfviewer=new PdfViewerControl();

pdfviewer.Load(...);  

pdfviewer.Print(true);




DD Divya Dhayalan Syncfusion Team August 11, 2021 05:04 PM UTC

Hi Grchen, 
 
We have tried to reproduce the issue with provided information. Unfortunately issue not reproduced from our end. We have converted the PDF by using the HTML page which contains the background image and checked the printed output. Where the background image also printed output. We have attached the HTML and PDF document for your reference which we have tried. Please find the below link for the attachments 
 
 
So, we request you to please share the below details. 
 
1.       Document which you have facing the issue. (If the document contains the confidential contents means we request you to create a new incident and share the details in the same.) 
2.       HTML file which you have converted into a PDF document. 
 
This information will help our side to reproduce the issue from our side and provide you a better solution.  
 
Regards, 
Divya 



GR grchen August 12, 2021 08:30 AM UTC

Hi, Divya,

Thank you for the reply.

And I will provide the related document that we are faced with.


regards,

grchen168



DD Divya Dhayalan Syncfusion Team August 13, 2021 10:39 AM UTC

Hi Grchen, 
 
Thank you for the update.  
 
We will wait for the documents to be shared from your side. If your document contains any confidential contents, please share the documents by creating a new incident using the below link. 
 
Regards, 
Divya 


Loader.
Up arrow icon