Results 1 to 2 of 2

Thread: How to properly read the properties of a xps file?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2011
    Posts
    268

    How to properly read the properties of a xps file?

    Hey all, im making an application where i get some properties of a xps file, like how many pages it has and type of sheet (a4 etc), the current way im doing it is from an example searched around the net:
    Code:
    XpsDocument xpsdoc;
                DocumentReference xpsdocReference;
                FixedDocument doc;
    
     xpsdoc = new XpsDocument(Properties.Settings.Default.PrintingDirectorySetting + "\\Selected\\" + splittedvalue[0].ToString(), System.IO.FileAccess.Read);
                    xpsdocReference = xpsdoc.GetFixedDocumentSequence().References.First();
                    doc = xpsdocReference.GetDocument(false);
    and then i just use doc.pages.count() to see how many pages that document has and then doc.close(), this is very slow it takes around 2-3 seconds to read 4 xps files, is there a faster way to achieve this? i might be missing something very obvious or not.

    Thank you very much for your replies as usual.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2011
    Posts
    268

    Re: How to properly read the properties of a xps file?

    Well performance impact is not the only problem, it clearly takes alot of ram everytime i refresh it just adds up to the ram over and over again non stop... i dont know why this is happening though.

    Anyways ive found a much faster way around the net:
    this article has all information needed, all i can say is the ram problem is gone and the performance difference is huge!

    http://www.codeproject.com/Articles/...g-in-XPS-Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width