MSDN > フォーラム ホーム > XML Paper Specification (XPS) > XPS Documents (Viewer in IE and Viewer EP) - Copy-Paste
質問する質問する
 

質問XPS Documents (Viewer in IE and Viewer EP) - Copy-Paste

  • 2009年2月15日 0:00Nate Walker ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    XPS has been proving itself to be useless lastely.  I've had it installed for a while on another machine, and quite frankly I am most likely going to buy Adobe Acrobat or some other PDF Distiller because the XPS Files and viewers are beta quality with bugs that you would not expect in "release" quality software.

    The biggest issue I have is Copying Test from an XPS Document in the IE or Stand-alone Viewer and pasting it in another editor or word processor (Word XP/2003 in my case, as well as Notepad and others).

    The text is copied (even if you use the menue option), but pasted with no whitespace in it.

    Example:

    You select the text "Today is a very good day for the XPS format."

    And when you paste it into Word/Notepad you will get "TodayisaverygooddayfortheXPSformat."

    Makes it useless for anything than document printing/distributing (but then again, the viewers aren't that great, anyways) and it's impossible to get anything out of the document.  I cannot use it with these bugs.  Is there any fix coming in for the Copy-Paste issues?

    And when can we expect a new viewer from Microsoft.  I will probably use it for another week or so, but I should have Acrobat on order by then, in which case I guess my qualms won't matter.  But I think a fix will help other people who continue to work with the XPS format, especially those who get these types of files and/or need to work with text displayed in an XPS document.

    And before the NiXPS person jumps in to plug his product:  I tried it and it's not that great - certainly not worth that amount of cash. 
    Nate Walker

すべての返信

  • 2009年2月15日 4:40adrian ford [MSFT] ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hi Nate,

    You hint the nail on the head: XPS is intended for printing and distribution of electronic paper (plus publication and archiving).

    I tried to repro your example: I printed this page from Firefox (v3.0.6) to the Microsoft XPS Document Writer to create an XPS file and then loaded in the IE-hosted XPS Viewer. This was on Windows Vista SP1, it looks like you're using Windows XP since you mention that you installed XPS. I could successfully copy and paste the line "XPS has been proving itself to be useless lastely." into notepad and wordpad and it was correctly pasted with the spacing between words.

    There's a couple of things that explain why you're seeing something different, and why that's often to be expected with fixed layout formats, like XPS. Fixed layout formats aren't designed for round trip editing, but they are designed to ensure that an exact layout is retained irrespective of viewer. For example, text is represented by the glyphs element in XPS which provides exact positioning of specific glyphs. This is good because it doesn't allow reflow of lines or changes in pagination, but that restriction makes it difficult to identify how text specified in the file markup relates to the logical reading order of the document.

    The ability to extract content, including structure, from an XPS document depends on a number of things:

    1. How was the XPS created and, critically, did the producing application generate markup that reflected the logical content on the page. For many XPS files the producing application is unaware of XPS - they are just printing to MXDW and are therefore unaware of either the importance of content ordering or of the additional hints that they could include.

    2. Does the XPS file include document structure. These hints (PDF has similar) enable consuming applications to make better guesses about the content on pages, for example how do multiple columns run together, what's the logical structure of tabular content, or to identify text in a margin note as separate from the main paragraph.

    3. How good is the consuming application at figuring out differences between the fixed layout content expressed in the page and the logical reading order. i.e. does it support document structure, or if document structure is absent, can it reverse engineer the original intent.

    If you really need to work with content from XPS documents, and working from the original authoring applications file formats isn't an option, then there are third party products that enable that (including Nuance, OneVision, NiXPS and others) and if you want an updated XPS Viewer from Microsoft take a look at the Windows 7 beta.

    /adrian

    PS meant to ask: how did you create the file that gives you the copying problem and what are the other bugs that you're hitting? Thx.


    http://blogs.msdn.com/adrianford
  • 2009年2月15日 5:19Nate Walker ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     

    I have to apologize for some of my elevated tone in the OP.  Your questions helped, and it seems I found out what the issue is.  I had an entire page in reply to you, then decided to try something...

    I think I can sum it up by saying the Opera Web Browser is not what you want to be using when you are printing things to XPS format.  I will just uninstall it and submit a "bug report" to their developers.  I usually only use it for browsing many pages at once, since it has faster tabbed browsing than IE.

    The document was presented as expected, and the format/structure of it was fine.  Pages that are printed from Opera just do not send any spaces to the clipboard when you copy text from it.

    The only other thing I can think of is the fact that the XPS viewers are sometimes finicky with selecting text.  If a paragraph has 10 lines in it, with 40 lines displayed in the viewer, and you select down those 10 lines to near the bottom of the viewable page; all your text will become unselected and the viewer will select everything else on the viewable page except the text you wanted selected.

    Sorry for the run-on :P

    And I didn't really think to test that until I read the last line in your post, which made me think I should probably check it in IE.

    I usually only print from web pages, since I can just make documents Read-Only in Microsoft Word.

    Once again, sorry, and many thanks.

    Opera-Printed XPS Page:  
    http://i211.photobucket.com/albums/bb280/UbahNecro/OperaXPS.png

    IE-Printed XPS Page:  
    http://i211.photobucket.com/albums/bb280/UbahNecro/IEXPS.png


    Nate Walker
  • 2009年2月15日 12:20nixps ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Hi Nate,

    Mr. Plug here ;-)

    If you hit problems with our software, do not hesitate to let us know (info@nixps.com), we would be glad to help out anyway we can.

    Kind regards,
    Nick.

    Check out my cross platform xps library and tools at http://nixps.com
  • 2009年6月18日 17:49komonoway ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Agreed.  If you think text is bad try using it to gather pages of table data, it throws it all to one colum when you dump an xps in excel.  Why?  I understand the purpose of the xps format, the whole keep it like it looks idea, but if I wanted to print something I'd click "print"...not save as .xps and then print.  This format is useless...in the most literal of senses...I cannot, use it, for anything.  Maybe it copies like it should if I had Vista, but from a company as 'ahead of the pack' as Microsoft I'd expect a little bit more than Zero backwards compatability.