.net - Userdefined margins in WPF printing -


most printing samples wpf go this:

        printdialog dialog = new printdialog();         if (dialog.showdialog() == true)         {            stackpanel mypanel = new stackpanel();            mypanel.margin = new thickness(15);            image myimage = new image();            myimage.width = dialog.printableareawidth;            myimage.stretch = stretch.uniform;            myimage.source = new bitmapimage(new uri("pack://application:,,,/images/picture.bmp"));            mypanel.children.add(myimage);            mypanel.measure(new size(dialog.printableareawidth, dialog.printableareaheight));            mypanel.arrange(new rect(new point(0, 0), mypanel.desiredsize));            dialog.printvisual(mypanel, "a great image.");         } 

what don't is, set margin fixed value. in printdialog user has option choose individual margin no sample cares about. if user selects margin larger fixed margin set program, printout truncated. there way user selected margin value printdialog?

tia michael

i sure margin changing in printdialog printer driver-specific setting. it's normal cannot access setting .net.


Comments

Popular posts from this blog

razor - Is this a bug in WebMatrix PageData? -

iphone - Requiring the presence of a method in an id -

xslt - Is it possible to select a node that just includes a subset of the child nodes? -