0

When take Printout the page size width=816.0,hieght=10560.0.now i want to reduce this size.

    PrintDialog dialog = new PrintDialog();
    double _width = dialog.PrintableAreaWidth;
    double _hieght = dialog.PrintableAreaWidth;
    dialog.PrintVisual(this, "My Window");

With this code i can _width=816.0 and _hieght=10560.0. Now i want to change the PrintableArea Width and height dynamically in wpf.What should i do for that.

enter image description here

Currently the SnagIt 8 is selected .if i click Print button in above figure.I will get one image. that image has size width 1200px and height 2128px.So i need change this size.

ASHOK A
  • 1,966
  • 3
  • 17
  • 31

1 Answers1

0

You need to create a custom DocumentPaginator class as in this SO question(it was about implementing a PrintPreview). and use it with the PrintDialog.PrintDocument Method.

Community
  • 1
  • 1
Mark Hall
  • 53,938
  • 9
  • 94
  • 111
  • What i mean is, if run this program what i mentioned above, it will show the dialog window and then i click select printer(CutePDF Writer) and click print button in dialog box.Then it is printing but it taking its own Printable width and height.So i need to change the installed printer's width and height. – ASHOK A Jun 22 '12 at 06:10
  • @user1459420 That is going to be printer specific, you will have to look at the print driver documentation to figure out what you are wanting to do, the proper way in this case would be to set the size of the page being sent to the printer. – Mark Hall Jun 22 '12 at 06:26
  • Mark Hall, i Edited may Post with figure, please check it. – ASHOK A Jun 22 '12 at 06:29
  • @user1459420 Take a look at this [Blog series on Printing Visuals](http://www.nbdtech.com/Blog/archive/2009/03/19/wpf-printing-part-1-printing-visuals.aspx) – Mark Hall Jun 22 '12 at 06:40
  • I tried that before as per the website what you mentioned above.But still it page width and height is not change. – ASHOK A Jun 22 '12 at 06:50