Set converted PDF file's (from DocumentEditor's SFDT file) paper size to A4

Hello,

I have implemented an endpoint in my ASP.NET Core project which makes a conversion from DocumentEditor's SFDT file to PDF file. The conversion process and endpoint itself are working fine, however the output PDF file's paper size is set to Letter by default and I couldn't find anywhere (in documentation,  forum threads and etc.) information about how and where to set the paper size to A4

I had a very similar situation with Spreadsheet component, but luckily there was a method called CustomPaperSize in XlsIORendererSettings​, where I was able to set the output PDF ​file's paper size to A4 in inches accordingly. Unfortunately for DocumentEditor, the DocIORendererSettings doesn't have the similar settings where I can change the paper size like in Spreadsheet's  XlsIORendererSettings.

Could you please help me?

Best Regards,

Ignacy Mielniczek


6 Replies

SM Suriya Murugan Syncfusion Team January 17, 2022 11:00 AM UTC

Hi Ignacy, 

Syncfusion Greetings! 

Using page setup dialog, customize the page layout and export it based on your requirement. 

Please check below documentation for reference: 


Please let us know if you have any questions.  

Regards. 
Suriya M. 



IM Ignacy Mielniczek February 22, 2022 10:14 PM UTC

Hello Suriya,


Even though setting the DocumentEditor's pageWidth and pageHeight accordingly to A4 size, it is not working as expected. For example:

this.documentEditorContainer.documentEditor.selection.sectionFormat.pageWidth = 595.30;
this.documentEditorContainer.documentEditor.selection.sectionFormat.pageHeight = 841.90;

The DocumentEditor generated PDF's paper size is different than other PDF pages generated by other components (which also have set paper size to A4).


Best Regards,

Ignacy Mielniczek


Attachment: example_png_da4ace64.rar


SM Suriya Murugan Syncfusion Team February 24, 2022 08:28 AM UTC

We will update the details shortly.



SM Suriya Murugan Syncfusion Team February 24, 2022 06:31 PM UTC

Hi Ignacy,


Can you please share the generated PDF document and input document whether in sfdt ot Docx format? that will be helpful for us to analyze regarding this issue.


Regards,

Suriya M.



IM Ignacy Mielniczek February 24, 2022 10:32 PM UTC

Hello Suriya,

Thank you very much for the help.

I was able to finally fix the problem by myself, by setting the paper size to A4 format using the DocumentEditorContainer's onDocumentChange() method every time:

  1. When the local files with .doc and .docx extensions were opened/imported using the Open function from Toolbar.
  2. When the previously DB stored SFDT file (json file)  was opened using DocumentEditorContainer.documentEditor.open() method.
Best Regards,
Ignacy Mielniczek


SM Suriya Murugan Syncfusion Team February 25, 2022 09:03 AM UTC

Thanks for your update.


Loader.
Up arrow icon