c# - Add and display FixedDocument to WPF form -


i'm programmatically generating fixeddocument me print. fixeddocument.actualwidth coming out 0. suspect because not displaying fixeddocument. how can add , display fixeddocument object?

this beginner question. i'm not skilled wpf. looked on msdn/goog. sites make assumption i've added fixeddocument , need manipulate it.

i have:

    private fixeddocument createfixeddocumentwithpages()     {                     fixeddocument fixeddocument = createfixeddocument();         fixeddocument.documentpaginator.pagesize = size;                      pagecontent content = addcontentfromimage();         fixeddocument.pages.add(content);          return fixeddocument;     } 

pseudocode of want: mywpfformobject.addchild(fixeddocument)

for show fixeddocument:

in wpf window, add documentviewer controle, set document property.

for actualwidth pb:

i think should call methods measure & arrange each fixedpage.

see code below exapmle in msdn:

size sz = new size(8.5 * 96, 11 * 96); fixedpage.measure(sz); fixedpage.arrange(new rect(new point(), sz)); fixedpage.updatelayout(); 

see https://stackoverflow.com/a/1695518/1271037


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -