Foxit Corporation Forums  

Go Back   Foxit Corporation Forums > Portable Document Format (PDF) Tools > SDK ( DLL or ActiveX)

SDK ( DLL or ActiveX) Integrate PDF functions into your application easily. The SDK shares the same technology that powers Foxit Reader.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 10th, 2008, 05:09 AM
jwozniak jwozniak is offline
Junior Member
 
Join Date: Jun 2008
Posts: 5
jwozniak is an unknown quantity at this point
Default OpenStream in C#

Hi,

I'm using Foxit Reader ActiveX in my c# (vs2005) application. After loading the pdf file into the byte array (I had to do the loading myself, because the file content is encrypted) I thought I would just create a c# MemoryStream and pass it to the Foxit OpenStream method. Unfortunately it seems that OpenStream method expects me to pass some IStream interface and I have no clue how to convert my byte[] array (or MemoryStream) to IStream.

I will be grateful for any tips.

Best regards,
Jacek
Reply With Quote
  #2  
Old June 10th, 2008, 07:18 AM
jwozniak jwozniak is offline
Junior Member
 
Join Date: Jun 2008
Posts: 5
jwozniak is an unknown quantity at this point
Default

Hi again,

OK, I solved my problem using OpenCustomFile. In case someone faces the same problem, here is the solution (c# pseudocode):

public class MyControl
{
// array of bytes containing the document
private byte[] documentArray = null;

public void Load(string path)
{
// 1. load the document to this.documentArray
// 2. use OpenCustomFile
this.axFoxitReaderSDK1.OpenCustomFile("")
}

// the two following methods are registered as event handlers in foxit control
private void axFoxitReaderSDK1_CustomFileGetSize(object sender, AxSDK_AXLib._DFoxitReaderSDKEvents_CustomFileGetSi zeEvent e)
{
e.size = this.documentArray.Length;
}

private void axFoxitReaderSDK1_CustomFileGetBlock(object sender, AxSDK_AXLib._DFoxitReaderSDKEvents_CustomFileGetBl ockEvent e)
{
Marshal.Copy(this.documentArray, e.pos, (IntPtr)e.pBuf, e.size);
}
}

Best regards,
Jacek
Reply With Quote
  #3  
Old July 18th, 2008, 06:56 AM
sricode sricode is offline
Junior Member
 
Join Date: Jul 2008
Posts: 4
sricode is an unknown quantity at this point
Default Help Needed to display pdf in window application c# using foxit

Hi i am new to foxit reader and i need to develop a window application ( C#) .NET in which i can display pdf files using foxit.
Can u please send me a SAMPLE C# CODE displaying an image and if possible how to customize it

thanks in advance
Reply With Quote
  #4  
Old July 21st, 2008, 07:22 AM
sricode sricode is offline
Junior Member
 
Join Date: Jul 2008
Posts: 4
sricode is an unknown quantity at this point
Default

i figured it out...

download latest sdk version and u get a foxit reader sdk control on ur toolbar from the com components(.net)

and u can also refer too
http://www.foxitsoftware.com/foxitre...eX20_guide.pdf
Reply With Quote
  #5  
Old July 25th, 2008, 08:47 AM
dennis82 dennis82 is offline
Junior Member
 
Join Date: May 2008
Posts: 9
dennis82 is an unknown quantity at this point
Default Openstream?

Hi,

I have seen that openstream and a few related commands. But.....what is it used for? It has something to do with loading a pdf in memory but then what? Can someone explain what is the practical use of these functions?

Thanks in advance for the explanation!


D.R. Reijgwart
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:13 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2005-2008 Foxit Corporation. All rights reserved.