PDF Viewer

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
daoa80
Posts: 44
Joined: Fri Aug 10, 2012 8:50 am

PDF Viewer

Post by daoa80 »

Is there an option on not to use the open file from the PDF Viewer and instead use a custom button to open the specified file directly?


button 1 open x.pdf file
button 2 open x2.pdf file and so on?

In that way I do not get the prompt box for what doc I want to open.


Thnaks

stuartm
Posts: 61
Joined: Thu Jun 06, 2013 9:21 am

Re: PDF Viewer

Post by stuartm »

Please check out this msdn resouce as well:

http://msdn.microsoft.com/en-us/library ... 10%29.aspx

1) Create a button on the canvas
2) Place the PDFViewer on the canvas
3) Click on the Script Tab
4) Write an event handler for your button(see code below)

void Button1_Click(System.Object sender, System.EventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();

if(fd.ShowDialog() == DialogResult.OK) {
PDFViewer1.FileName = fd.FileName;
}

}

daoa80
Posts: 44
Joined: Fri Aug 10, 2012 8:50 am

Re: PDF Viewer

Post by daoa80 »

Thanks for the feedback. But it looks like OpenFileDialog is the same as clicking on the open button from the PDFViewer and selecting a file. The idea is to click on the custom button an automatically open the pdf file using the PDFViewer w/o selecting a file from a list.

Thanks

daoa80
Posts: 44
Joined: Fri Aug 10, 2012 8:50 am

Re: PDF Viewer

Post by daoa80 »

I got it. Thanks for your help.

aperez
Posts: 8
Joined: Fri Feb 26, 2016 9:42 am

Re: PDF Viewer

Post by aperez »

Hi,

I need to open a PDF file from a button and I tried the example of stuartm but it didn´t work.
Why did you choose PDFViewer1 ?

I can see in my script PDFViewer without 1 and I put Variadorabb instead of Filename because my file has this name.

void Button26_Click(System.Object sender, System.EventArgs e)
{
OpenFileDialog fd = new OpenFileDialog();

if(fd.ShowDialog() == DialogResult.OK)
{
PDFViewer.Variadorabb = fd.Variadorabb;
}
}

Regards.
Antonio

Post Reply