PDF landscape issues

Hi SF,

When generating a PDF from HTML to PDF with the Blink converter I'm experiencing a couple issues with the landscape mode:

1. First, when trying to reproduce it with the latest dlls version on a simple example, the landscape mode isn't working with my settings (it still shows portrait, see attached sample).

2. When landscape actually works (on the our internal version), the images on header are streaching out in a weird way (see attached screenshots). 


Thanks in advance,

Attachment: Streching_images_abf7a3f6.zip

12 Replies

GK Gowthamraj Kumar Syncfusion Team January 18, 2021 12:09 PM UTC

Hi Juan, 
 
Thank you for contacting Syncfusion support. 
 
Queries 
Response 
1. First, when trying to reproduce it with the latest dlls version on a simple example, the landscape mode isn't working with my settings (it still shows portrait, see attached sample). 
We have checked the conversion with provided sample in our end, we are were able to reproduce the reported orientation issue with Print MediaType. Currently, we are validating on this “Landscape orientation not working properly while converting Html to PDF with MediaType.Print using Blink” and we will update the details on January 20th 2021. 
  
2. When landscape actually works (on the our internal version), the images on header are streaching out in a weird way (see attached screenshots).  
Kindly please provided more details about the issue such as complete html file with all the resources, sample, internal version (which you are mentioned) to reproduce the issue. So, that it will be helpful for us to analyze and assist you further on this.  
  
 
Regards, 
Gowthamraj K 



JJ Juan Jiminez January 18, 2021 01:21 PM UTC

Hi Gowthamraj,

Thanks for looking into this. 

I've been trying to reproduce issue #2 on a simple code sample (as we have a very complex PDF structure on our internal tool which I can't share) but issue #1 is preventing me for doing it. We'll need to wait until issue #1 is fixed to test issue #2 and prepare an updated sample.

Best,


GK Gowthamraj Kumar Syncfusion Team January 19, 2021 11:44 AM UTC

Hi Juan, 

Thank you for your patience. 

As we said earlier, we are validating on this “Landscape orientation not working properly while converting Html to PDF with MediaType.Print using Blink” and we will update the details on January 20th 2021. 

Regards, 
Gowthamraj K 



GK Gowthamraj Kumar Syncfusion Team January 20, 2021 06:48 PM UTC

Hi Juan,  
 
Thank you for your patience. 
 
On further analysis, the reported issue occurs only in print MediaType using Blink. Its working properly in screen MediaType. We internally make use of chromium executable in headless mode for converting HTML to PDF. Blink rendering engine preserves the output PDF document like how the input HTML file/URL is displayed on the web browsers (chrome). In chromium source, they have separate default orientation settings for print media type, so that, the our converter settings (Orientation) are not do any effect. This is the default behaviour of Print media type. Kindly please try the change the media type as screen and let us know it is suites your requirement.    
 
 
Regards, 
Gowthamraj K 



JJ Juan Jiminez January 20, 2021 07:47 PM UTC

Hi Gowthamraj,

Unfortunately we can't use media = screen because we have some other requirements on our PDFs which require media = print (page breaks, etc).

I tried changing the sample to this with no success:  

 @@media print {
            /* Overwrite boostrap page size */
            @@page {
                size: letter landscape;
            }
        }

This used to work on previous versions so I'm not sure what changed.


GK Gowthamraj Kumar Syncfusion Team January 21, 2021 03:59 PM UTC

Hi Juan, 
 
Thank you for your update. 
 
Kindly please share the complete HTML file (with all the resource style, script, etc) for your webpage content (header, body, footer). So, that it will be helpful for us to analyze and check the other possibilities by modifying the styles to achieve your requirement in our end.  
 
Regards, 
Gowthamraj K 



JJ Juan Jiminez January 22, 2021 05:56 PM UTC

Hi Gowthamraj,

By taking a closer look at the sample I realized there was another place where landscape needed to be set, so issue number #1 is no longer a problem and we cna procede to work on issue #2 "images on header are streaching out in a weird way when on landscape mode". 

I'm attaching an updated sample.

Attachment: Streching_images_ecc206.zip


SL Sowmiya Loganathan Syncfusion Team January 25, 2021 12:11 PM UTC

Hi Juan,  

Sorry for the inconvenience.  

Currently we are working on your query and will update the further details on January 27, 2020.  

Regards, 
Sowmiya Loganathan 



GK Gowthamraj Kumar Syncfusion Team January 27, 2021 04:05 PM UTC

Hi Juan, 
 
Thank you for sharing the details. 
 
We have checked the conversion with provided sample in our end, we were able to reproduce the reported image shrinking issue. Currently, we are validating on this and we will update the details on January 29th 2021. 
 
Regards, 
Gowthamraj K 



PV Prakash Viswanathan Syncfusion Team January 29, 2021 05:08 PM UTC

Hi Juan, 
 
Thank you for your patience.  
 
We have modified the provided sample to resolve the reported header footer stretch issue, please find the modified sample and output PDF document from below links, 
 
Please let us know if you need any further assistance on this.  
 
Regards, 
Prakash V 



JJ Juan Jiminez February 1, 2021 04:17 PM UTC

Thanks Prakash,


Making the header always render on portrait mode while still calculating the height on landscape does the trick.


GK Gowthamraj Kumar Syncfusion Team February 2, 2021 04:54 PM UTC

Hi Juan, 
 
Thank you for the update. Please let us know if you need any further assistance on this.  

Regards, 
Gowthamraj K 


Loader.
Up arrow icon