Hello All,
I have been using this site many times already whenever I get stuck on creating applications. However, I can't seem to find any post regarding my question.
I was assigned to create a windows application that will be able to display the PDF file on the same screen. I tried using PDF Viewer .NET but it only allowed a limited trial use. I tried searching for other alternatives but couldn't find any.
Do you guys know of a way to view a PDF file in a windows application? A third party software without limited trial which can help? Or perhaps a snippet of the code on how to view PDF files. Thanks!
Loading
Leon DPosted Jun 24, 2020, 8:27 PM
Kip HackmanPosted Jun 24, 2020, 3:31 PM
You can use LEADTOOLS Document Imaging SDK technology in your application.
https://www.leadtools.com/sdk/document-imaging
The Document Viewer technologies allow you to view documents and images, as well as text search and annotate documents.
Here is some sample code:
Vimal KandasamyPosted May 26, 2009, 12:11 AM
after adding adobe acrobat reader 7.0 browser document in windows form .
i just set src property of it like
axAcroPDF1.src = "d:\\111.pdf";
in form loading event.
nothing more than this.
Make sure your file path is correct &
try it with different files.
Lemuel MallariPosted May 25, 2009, 8:54 PM
Thanks for the suggestion. Can you show me a sample code for this? I adding the following in my code after adding the browser document but it gave me an error saying that it cannot open the document:
axAcroPDF1.src =
Did I do something wrong? Thanks!
Vimal KandasamyPosted May 25, 2009, 2:45 AM
For my application,
I just open Choose Tool Box Items dialog by right clicking on toolbox and select COM components tab.
then select adobe acrobat reader 7.0 browser document
( I already install adobe acrobat reader 7.0 in my system.Its free s/w.so only this component appears here i think so.).
after selection i just click ok .now axAcroPDF1 is added into tool box.
i just add it to windows form and set its src property as my pdf file in form loading.and it works well.
Hope this helps u.
Suchit KhannaPosted May 25, 2009, 2:41 AM
class Program
{
const int ERROR_FILE_NOT_FOUND = 2;
const int ERROR_ACCESS_DENIED = 5;
void OpenPDF()
{
Process myProcess = new Process();
try
{
string myPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
myProcess.StartInfo.FileName = myPath + "\\linq.pdf";
myProcess.StartInfo.Verb = "Open";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
}
catch (Win32Exception e)
{
if (e.NativeErrorCode == ERROR_FILE_NOT_FOUND)
{
Console.WriteLine(e.Message + ". Check the path.");
}
else
{
Console.WriteLine(e.Message +
". You do not have permission to print this file.");
}
}
}
static void Main(string[] args)
{
Program myProgram = new Program();
myProgram.OpenPDF();
}
}
Suchit KhannaPosted May 25, 2009, 2:34 AM
Now my question to you is, Is the file being recieved on internet or is already there in the system and you want to read it in your application, if that is the case I would suggest you to go for first case and if file is recieved on network latter would be a better solution.