Summarize annotations in memory

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

reinierkops
User
Posts: 93
Joined: Mon Jul 07, 2008 8:41 am

Summarize annotations in memory

Post by reinierkops »

Is there a possibility to summarize a PDF in memory.
Now I need to load a PDF in a viewer (what is already placed on a form), and then I can summarize.
Why can't I create an instance of a viewer, and then summarize in that instance?
reinierkops
User
Posts: 93
Joined: Mon Jul 07, 2008 8:41 am

Re: Summarize annotations in memory

Post by reinierkops »

This error I receive when I execute this code:

AxCoPDFXCview viewer = new AxCoPDFXCview();
viewer.OpenDocument(aDocument);

System.Windows.Forms.AxHost.InvalidActiveXStateException was unhandled
Message="Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown."
Source="AxInterop.PDFXCviewAxLib"
StackTrace:
at AxPDFXCviewAxLib.AxCoPDFXCview.OpenDocument(String sourceFileName)
at nl.rechtspraak.zidos.ui.forms.DossierViewer.nl.rechtspraak.zidos.ui.library.interfaces.commands.ICmdAddSummaryToWordDocument.Execute(Object aCargo) in X:\Projects\Zidos\rr.zidos\19-branches\1.2\Zidos.UI\forms\DossierViewer.cs:line 1975
at nl.rechtspraak.zidos.ui.library.ui.commands.CmdAddSummaryToWordDocument.ExecuteImpl(Control aControl, Object aCargo) in X:\Projects\Zidos\rr.zidos\19-branches\1.2\Zidos.UI\library\ui\commands\CmdAddSummaryToWordDocument.cs:line 33
at nl.rechtspraak.zidos.library.general.ui.CommandBase.DoBroadcast(Control aControl, Object aCargo) in X:\Projects\Zidos\rr.zidos\19-branches\1.2\Zidos.Library\general\ui\CommandBase.cs:line 150
at nl.rechtspraak.zidos.library.general.ui.CommandBase.DoBroadcast(Control aControl, Object aCargo) in X:\Projects\Zidos\rr.zidos\19-branches\1.2\Zidos.Library\general\ui\CommandBase.cs:line 156
at nl.rechtspraak.zidos.library.general.ui.CommandBase.DoBroadcast(Control aControl, Object aCargo) in X:\Projects\Zidos\rr.zidos\19-branches\1.2\Zidos.Library\general\ui\CommandBase.cs:line 156
at nl.rechtspraak.zidos.library.general.ui.CommandBase.Broadcast(Control aControl, Object aCargo) in X:\Projects\Zidos\rr.zidos\19-branches\1.2\Zidos.Library\general\ui\CommandBase.cs:line 130
at nl.rechtspraak.zidos.ui.usercontrols.Spam message posted by BOT engine - ignore - to be deleted by admin.AnnotationToolsControl.buttonAdvOpenPreparationDocument_Click(Object sender, EventArgs e) in X:\Projects\Zidos\rr.zidos\19-branches\1.2\Zidos.UI\usercontrols\Spam message posted by BOT engine - ignore - to be deleted by admin\AnnotationToolsControl.cs:line 750
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at Syncfusion.Windows.Forms.ButtonAdv.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at Syncfusion.Windows.Forms.ButtonAdv.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at nl.rechtspraak.zidos.ui.Program.Main(String[] args) in X:\Projects\Zidos\rr.zidos\19-branches\1.2\Zidos.UI\Program.cs:line 25
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Summarize annotations in memory

Post by Corwin - Tracker Sup »

You want to create viewer in runtime (dynamically)?
reinierkops
User
Posts: 93
Joined: Mon Jul 07, 2008 8:41 am

Re: Summarize annotations in memory

Post by reinierkops »

yes
Corwin - Tracker Sup
User
Posts: 664
Joined: Tue Nov 14, 2006 12:23 pm

Re: Summarize annotations in memory

Post by Corwin - Tracker Sup »

Well, Viewer ActiveX won't work without parent form.
However if you want to dynamically add new AX component to your form in C# you can use something like this:

Code: Select all

AxPDFXCviewAxLib.AxCoPDFXCview axCoPDFXCview1;
//
axCoPDFXCview1 = new AxPDFXCviewAxLib.AxCoPDFXCview();
((System.ComponentModel.ISupportInitialize)(axCoPDFXCview1)).BeginInit();

axCoPDFXCview1.Enabled = true;
axCoPDFXCview1.Location = new System.Drawing.Point(211, 29);
axCoPDFXCview1.Name = "axCoPDFXCview1";
axCoPDFXCview1.Size = new System.Drawing.Size(192, 192);
axCoPDFXCview1.TabIndex = 1;
//
this.Controls.Add(axCoPDFXCview1);
((System.ComponentModel.ISupportInitialize)(axCoPDFXCview1)).EndInit();

axCoPDFXCview1.OpenDocument("e:\\RevisionMakup.pdf");