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

I need to apply pagesize dynamically based on the user selection

Hi,

I need to assign page size selected by user to pdfdocument. As per
My observation pdfPageSize does not support all the sizes supported by Microsoft class
Page setup. My requirement is if user selects postcard size, A4, A6 or letter etc, I need to apply that page size to pdfdocument.

I am using the Syncfusion 6.4.0.15 version

Thanks and Regards

Srinivas


3 Replies

BP Bhuvaneswari P Syncfusion Team February 17, 2009 11:04 AM UTC

Hi Srinivas,

We do have support for setting the Built-in [which are size supported by Microsoft class]and custom page size. Please try to set the required page size by using the below code snippet:


//To set the document page setting using Built-in size
doc.PageSettings.Size = PdfPageSize.Letter;
//doc.PageSettings.Size = PdfPageSize.A6;
//doc.PageSettings.Size = PdfPageSize.A4;


//To set the document page setting by specifing the custom size
doc.PageSettings.Size = new SizeF(100, 100);


Please try this and let us know if this helps you.

Best Regards,
Bhuvana




AD Administrator Syncfusion Team February 17, 2009 01:06 PM UTC

Hi Bhuvana,

Thanks for your reply,That works fine for setting page Size static.My requriment is user
selects page size for eg:-Letter,A4 A6 etc from page setup option.Then i will take pagename from below code

pageSetup.Pagesettings.PageSize.PaperName;

If user selects page Size of Letter than my pageName is in string 'Letter',Now i need to compare this string with pdfPageSize and set the matched pageName to the document.


But i could not able to do that.According to my observation and testing by using pdfPageSize it is not possible to apply page size dynamically.


Please try to understand my requriment.User inputs or selects the page for eg letter,A4 etc.Based on the user selected page i need apply the page size.

Waiting for your reply.

Thanks and Regards
srinivas




DK Dhivya K Syncfusion Team February 18, 2009 04:39 PM UTC

Hi Srinivas,

Thank you for your inquiry! We appreciate the opportunity to assist you.

We have noticed you've submitted a number of specific technical inquiries here in the Forums which seem to indicate you are a current customer rather than an evaluator or tester. If so, you might like to know that you have an existing personal Direct-Trac account available using your own email address, and we highly recommend using your personal account. You'll get a faster response along with an automatic update when your question is answered via Direct-Trac, and you can login and view your incident history 24x7. Simply visit https://www.syncfusion.com/Support/DirectTrac/logon.aspx?URL=/Support/DirectTrac/default.aspx to login. If you have any further questions, we hope you will take advantage of your existing account and services as a license holder.

Regards,
Dhivya.

>Hi Bhuvana,

Thanks for your reply,That works fine for setting page Size static.My requriment is user
selects page size for eg:-Letter,A4 A6 etc from page setup option.Then i will take pagename from below code

pageSetup.Pagesettings.PageSize.PaperName;

If user selects page Size of Letter than my pageName is in string 'Letter',Now i need to compare this string with pdfPageSize and set the matched pageName to the document.


But i could not able to do that.According to my observation and testing by using pdfPageSize it is not possible to apply page size dynamically.


Please try to understand my requriment.User inputs or selects the page for eg letter,A4 etc.Based on the user selected page i need apply the page size.

Waiting for your reply.

Thanks and Regards
srinivas





Loader.
Live Chat Icon For mobile
Up arrow icon