Hi, I am evaluating the PDF Viewer and have run into a snag: If I run the sample code, or even start a new project and drop the viewer on a fresh form, I can see the toolbar. However, if I drop the viewer into my application, by default it is missing the toolbar, and if I try to use DynamicPDFViewerControl1.ShowToolBar(1), it doesn not show the toolbar, and actually makes the PDF document invisible. Obviously, since it works in a fresh project, something in my project is causing it - any ideas what could be causing it?
Thanks!
Jef
Toolbar Not Visible
Re: Toolbar Not Visible
Forum member · Mar 29, 2011Looks like the problem occurs when the viewer is placed in an mdi child form. Is this a bug, or is there a particular reason for hiding the toolbar?
Thanks again!
Jef
Re: Toolbar Not Visible
Support · Mar 30, 2011Hello Jef,
We were able to reproduce this behavior on our end, and it seems like a bug. We will forward this information to our development team and have them look into it further.
Thanks,
ceTe Software Support Team.
Re: Toolbar Not Visible
Forum member · Mar 30, 2011Thanks! Please keep me posted on the progress of fixing the bug. I believe that your product may be the best fit for my application, but I really would like to be able to use it properly in a child window.
Re: Toolbar Not Visible
Support · Apr 1, 2011Hello Jef,
We have reported this issue to our development team. Once a fix is available we will post a fix here in the forum. If you need further updates please send an email to [^a|mailto:support@cete.com|opennewiwndow|support@cete.com^] referring to the url of this forum posting.
Thanks,
ceTe Software Support Team.
Re: Toolbar Not Visible
Forum member · May 18, 2011Hi I'm following up on this - I discovered that if the viewer is placed in a container like a group box or tab control, it will function OK in an mdi child window.
Thanks!
Jef
Re: Toolbar Not Visible
Support · Dec 2, 2011Hello,
Our developers suggested a solution listed below to resolve this problem when using the DynamicPDF Viewer in a MDI child form.
One of the solutions to resolve this is to add the Viewer control dynamically during run time to the MDI child form. This can be done by adding the below code in the Form_Load event.
Dim pdfViewer As ceTe.DynamicPDF.AxViewer.Control.DynamicPDFViewerControl =
New ceTe.DynamicPDF.AxViewer.Control.DynamicPDFViewerControl()
pdfViewer.Dock = DockStyle.Fill
pdfViewer.Parent = Me
Me.Controls.Add(pdfViewer)
Another solution as suggested by the customer in the last post is to place the Viewer control during design time inside a group box or tab control on the MDI child form.
Thanks,
ceTe Software Support Team.
Re: Toolbar Not Visible
Forum member · Jan 6, 2014Hi, I following the code and didn't work. Do I miss something?
There is the code to adding the control
private void Form2_Load(object sender, EventArgs e)
{
ceTe.DynamicPDF.AxViewer.Control.DynamicPDFViewerControl pdfViewer = new ceTe.DynamicPDF.AxViewer.Control.DynamicPDFViewerControl();
pdfViewer.Dock = DockStyle.Fill;
pdfViewer.Parent = this;
this.Controls.Add(pdfViewer);
}
The following code is on my MidForm (main form) to show the viewer:
private void OpenFile(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Title = "Open File Dialog";
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
openFileDialog.Filter = "Adobe PDF files (*.pdf)|*.pdf";
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
{
string FileName = openFileDialog.FileName;
Form2 f = new Form2();
f.MdiParent = this;
f.Show();
}
}
The error is:
Could not load file or assembly 'ceTe.DynamicPDF.AxViewer.Control, Version=2.0.0.0, Culture=neutral, PublicKeyToken=09b5ce0d5c0a9d8b' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Re: Toolbar Not Visible
Support · Jan 7, 2014Hello,
The code you have posted looks good. The error might happen if the .NET project’s platform is set incorrectly. The DynamicPDF Viewer is a 32-bit component and if you are running the application on a 64-bit computer set the target platform to x86 before running the project. This makes sure the exe is built as a 32-bit application and it work on both 32 & 64-bit machines.
Thanks,
ceTe Software Support Team.
Re: Toolbar Not Visible
Forum member · Jan 7, 2014Thanks. It works