How to change size and margin while converting from html to pdf

Hi ,
I am new to Aspose , i am using aspose word for converting html to pdf stream .using following code

public byte[] RenderPdf(string htmlText)
{
    Document doc = new Document();
    DocumentBuilder builder = new DocumentBuilder(doc);
    builder.InsertHtml(htmlText);

    PdfSaveOptions options = new PdfSaveOptions();
    options.Compliance = PdfCompliance.PdfA1b;
    MemoryStream memStream = new MemoryStream();
    doc.Save(memStream, options);
    memStream.Position = 0;
    byte[] bArrContent = memStream.ToArray();
    memStream.Dispose();
    return bArrContent;
}

I need to change the default pdf size and set margin to document .Is there any option for doing it .?
Thanks in advance…

Hi Syam,

Thanks for your inquiry. Sure, you can change the document size and margins by using the PageSetup class. Moreover, I would suggest you please read the following article:
https://docs.aspose.com/words/net/convert-between-measurement-units/

If we can help you with anything else, please feel free to ask.

Best Regards,