locked
RTF to PDF question RRS feed

  • Question

  • I use this forum as I usually do with a VB question.  I know this question is not directly about VB, but my project I am creating is.  If this is not the forum, do you know what would be?  I am using the Office.Interop Word assembly to take the text from a RichTextBox control and convert this to a PDF file and yes, it is working fine.  However, the margins and paper size are not correct during this conversion.  And I dont know if those parameters lie with the RTF markup or the Word conversion document itself.  The page defaults to portrait, 8.5 x 11, but I would like landscape.  

    Thanks for any direction or information you might have.

    This is an example:

    The RTF table

    The converted PDF file

    Everything else is good with the RTF to PDF conversion, including proper footers and page breaks.  I just need to understand how to handle the page setup.

    UPDATE: As sometimes happens, I tend to answer my own question when I post comments to forums.  I am thinking that it is the calculation of twips across the page.  A page in landscape has 15,840 twips and this table calculates out more than that.  


    Brad Allison


    Wednesday, September 2, 2020 12:07 PM

All replies

  • Hi guyinkalamazoo3,

    Thank you for posting here.

    >>Everything else is good with the RTF to PDF conversion, including proper footers and page breaks.

    Could you provide some related code here? It will help us make a test and reproduce your problem.

    We are waiting for your update.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, September 3, 2020 2:36 AM