Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
Export to PDF
posted

Hi Can you point me to a VB example of how to export a chart as a PDF in the latest version of Netadvantage for winforms. I need to create the chart in code and save it as a PDF without user intervention.

Thanks

    • 475
      posted in reply to David Negley

      This URL can no longer be found

    • 50
      posted in reply to David Negley

      Hi David

      Are there any format settings I can make to the PDF? I would like the chart to be landscape, currently I only get a portrait view that I can't seem to change. Cheers

      • 50
        posted in reply to David Negley

        That worked great. Thank you

        • 28496
          Offline posted in reply to David

          i'm no expert on the documents library, but i'm going to make an educated guess and say you need to reference the Section object and set its PageOrientation property to Landscape.  

          so change this:

          Dim g As Graphics = r.AddSection().AddCanvas().CreateGraphics()
          UltraChart1.RenderPdfFriendlyGraphics(g)

          to this:

          Dim s As ISection = r.AddSection()
          s.PageOrientation = PageOrientation.Landscape
          Dim g As Graphics = s.AddCanvas().CreateGraphics()
          UltraChart1.RenderPdfFriendlyGraphics(g)

           

        • 50
          posted in reply to David Negley
          Thanks for the quick response David. Exactly what I was looking for. Cheers