in wpf app, have several fixeddocument objects, want display in documentviewer, if single document.
it's easy display single fixeddocument in document viewer:
mydocumentviewer.document = myfixeddocument;
my first idea create fixeddocumentsequence of fixeddocuments (which can set documentviewer.document value implements idocumentpaginatorsource). when building fixeddocumentsequence, 1 can add collection of documentreference objects. there no straightforward way add fixeddocument directly, , can't figure out how create , add documentreference somehow linked 1 of fixeddocuments.
my second idea create master fixeddocument, , loop through fixeddocuments, , move pages master fixeddocument. run sort of issues when trying (to pages belonging document (with no ability remove them document! etc. etc.)
my third idea create , build temporary xpsdocument, , retrieve fixeddocumentsequence automatically seems create. i've looked @ bit, it's getting feels needlessly complex, thought i'd post here first see if there other ideas, or first 2 attempts!
figured out.
you can in fact, dynamically create documentreference objects linked fixeddocuments:
var documentreference = new documentreference(); documentreference.setdocument(document); fixeddocumentsequence.references.add(documentreference);
i'm not quite sure how missed setdocument
method before. think must have been looking documentreference.document
property getter/setter. little inconsistent in .net framework instead have getdocument , setdocument methods, in opinion.
Comments
Post a Comment