GHFatal

Does anyone know how to convert a file being stream or stored as a byte array to XPS


Re: XML Paper Specification (XPS) Stream files byte array to xps


Re: XML Paper Specification (XPS) Stream files byte array to xps

GHFatal

I have taken a look at that post before, but that post is converting an XPS document to an array of bytes. I'm trying to convert a file like Microsoft Word or Excel or PDF into XPS but the file is being pass as an array of bytes or a stream instead of an actual file. I can convert from word or excel into XPS fine when I have the file stored already on the hard drive, but not when it is still in memory as an array of bytes or stream.
Thanks for the reply though.




Re: XML Paper Specification (XPS) Stream files byte array to xps

merasheen

Taking Word as an example, I'll ask some clarifying questions.

Is the data in the stream in Word format or XPS If it's in Word format, you need to determine if it's one of the 2007 formats based on OPC, or the previous versions. If it's based on OPC (.docx extension) then you can consume it using the System.IO.Packaging classes (Package can be opened on a Stream). If it's an older format, you'll have to find some code that is aware of binary Word file format (not sure where you can get this) and synthesize an XPS file from that (the Packaging classes can help you here as well).






Re: XML Paper Specification (XPS) Stream files byte array to xps

GHFatal

Yeah I use the packaging classes to convert a streamed image into XPS, but I didn't know how to convert word or excel or pdf to xps. I need to convert both formats in OPC and older versions. How do you consume the OPC in the Packaging classes Do you store it into a resource
Thanks.




Re: XML Paper Specification (XPS) Stream files byte array to xps

merasheen

The Packaging classes consume and produce OPC (Open Packaging Conventions) which is the underlying format for XPS and the Office 2007 files (all of the docx, xlsx, etc). Previous versions of Office generated binary files that have no relation to OPC. For these, there is plenty of information available on the web (as well as Office development tools to crack the bits). For PDF, i'm not that familiar - i'd look at Adobe's site for details on that format.






Re: XML Paper Specification (XPS) Stream files byte array to xps

GHFatal

Thanks for the info on the OPC, but I'm guessing you're not sure how to fix the problem with older versions of words and excel and pdf




Re: XML Paper Specification (XPS) Stream files byte array to xps

GHFatal

I search online for information on convertion stream .docx and .xlsx to .xps, but I couldn't find the information. Could you lead me to the information
Thanks,