Can the ReaderControl load byte array

27 views
Skip to first unread message

Mike McFarland

unread,
May 13, 2013, 9:09:58 PM5/13/13
to silv...@googlegroups.com
I am using SilverDox and have a WCF service that converts a pdf byte array from a database to and Xod byte array. How do you load a byte array in the reader control? Is there a example?
 
So far I have tried:
 

HttpStreamingPartRetriever partretriever = new PDFTron.SilverDox.IO.HttpStreamingPartRetriever();

partretriever.AddBytes(e.Result, e.Result.Length)

Action<Exception> callback = null;

myReaderControl.DocumentViewer.Document.LoadAsync(partretriever, callback);

 

I don't quite understand the Action<Exception>... Am I close?

James

unread,
May 14, 2013, 2:31:44 PM5/14/13
to silv...@googlegroups.com
Hi Mike,

You can do this in a couple of different ways. The easiest is if you have a byte array that contains the entire XOD, then you can convert it to a MemoryStream, and use the stream to construct a LocalPartRetriever.

On the other hand if you are converting the PDF to a XOD in a streaming manner and want to feed it to SilverDox as the conversion is taking place, you can use the HttpStreamingPartRetriever as shown in the answer to the 2nd question of this forum post:


Please let us know if this helps and if you have any other questions.

Reply all
Reply to author
Forward
0 new messages