so printing out text textbox, has wordwrapping enabled, when print out document, string should wordwrapped not, , cuts offs on page. i'd enable word wrapping printed document. there way set margins printed document, of text gets cut off both top , left margins. thanks! code attached below.
fixeddocument document = new fixeddocument(); document.documentpaginator.pagesize = new size(printdlg.printableareawidth, printdlg.printableareaheight); fixedpage page1 = new fixedpage(); page1.width = document.documentpaginator.pagesize.width; page1.height = document.documentpaginator.pagesize.height; messagebox.show(page1.height.tostring() + page1.width); gridtype.children.remove(textbox); page1.children.add(textbox); pagecontent page1content = new pagecontent(); ((iaddchild)page1content).addchild(page1); document.pages.add(page1content); printdlg.printdocument(document.documentpaginator, "my first document"); page1.children.remove(textbox); gridtype.children.add(textbox);
your textbox setting won't applied in printdoc .. must recalculate in printdoc printpage event
Comments
Post a Comment