Menu

PDF in DesignerWt

2017-03-14
2017-03-14
  • Ron Tidwell

    Ron Tidwell - 2017-03-14

    Hi,

    As a Newbee to Designer Wt, I need some help. How do create a PDF in DesignerWt? I have tried to use the example from the Wt documentation but I get errors: Wt::WPdfImage’ is not a direct base of my application. I am sure there must be a way to do this. Any example or help would be greatly apprecated.

    I want to draw the PDF myself.

    Thanks,
    Ron

     
    • Nigel Lea

      Nigel Lea - 2017-03-14

      Hi Ron

      This is really a Wt question and is best asked on the Wt forum.

      However I have written a SVG file using WSvgImage, this is the same process as writing to a PDF using WPdfImage.

      You should be able to do something like

      Wt::WPdfImage pdf;
      Wt::WPainter painter(&pdf);
      painter.begin(&pdf);
      
      //then use painter methods such as drawLine(), drawText() etc
      
      painter.end();
      
      //finally declare a stream to specify the file and do
      pdf.write(stream); 
      

      Regards

      Nigel

       
  • Ron Tidwell

    Ron Tidwell - 2017-03-15

    Hi Nigel,

    Thank you so much.

    Ron

     

Log in to post a comment.

MongoDB Logo MongoDB