How to -Set Custom Page Size and get cell width as per value

Hi Support team,


1.I need to set page width as 8.5x11 , its not available in Page size enum (its close to A4 width),
is there a way to set custom page width.

2.I need to add column in table only if its width is not greater than
(section page width-left margin width -right margin width),but when I try to get cell width /row width or table column width (after creating them)it comes as 0 since I haven’t set it manually because I don’t know what will be the size of text.Is there a way to get max table column width ?to make sure that it should not exceed page width ?I can not use isVerticalyBroken =true since I need to keep some column constant through out the pdf.(Is there a way to keep column constant?)

Any help will be appreciated.


Regards,
Ankit

Hi Support Team,


Any suggestions on #1 and #2

Regards,
Ankit

Hi Ankit,


You can set custom page size by using PageSize class constructor, Pagesize(floatx,floaty). As basic measuring unit of Aspose.Pdf is point and 1 inch consist of 72 points. So please get your desired page size as following.


PageSize(8.5*72,11*72)


Moreover for your second query please check the documentation link for a general idea.


Hopefully it will serve the purpose.If there is any confusion please share your sample code here. So we will look into it and provide you more information accordingly.


Please feel free to contact us for any further assistance.


Best Regards,