How do I convert XPS to Image on the fly ?

14 views
Skip to first unread message

Support

unread,
Dec 5, 2012, 3:00:35 PM12/5/12
to pdfne...@googlegroups.com
Q:
 
I need to convert XPS to Image on the fly. I mean a byte array as xps, and exporting a byte array of image.
 
Can I do this with PDFNet? on all platforms - Windows, Mac, Linux, mobile ?
 
------------
A:
 
Yes, you can do this with along the following lines:

 

PDFDoc doc = new PDFDoc();

Convert.FromXps(doc, buf, buf_size);

PDFDraw draw = new PDFDraw();

 

for (PageIterator itr=doc.GetPageIterator(); itr.HasNext(); itr.Next())  {

   string outname = string.Format("{0}newsletter{1:d}.jpg", output_path, itr.GetPageNumber());

   Bitmap bmp=draw.GetBitmap(itr.Current());

}

Apart from syntax issues you can do the same on Java, .NET, C/C++, Obj-C, Pyhon, Android, etc.
 
 
Reply all
Reply to author
Forward
0 new messages