I've sent you a mail with this content:
and received this answer:I encountered a problem with the use of PDFs in GdPicture.NET.
I have to load a PDF as byte[ ] with GdPicture to perform an "Automatic Document Recognition" on it.
Is there an option other than loading the byte[ ] with GdPicture.GdViewer.DisplayFromByteArray(byte[ ]) followed by GdPicture.GdViewer.PdfRenderPageToGdPictureImage(int,int)?
I can't use the GdViewer because the ADR is performed in a WindowsService, so there is no GUI available. I tried loading the PDF byte[ ] with GdPictureImaging.CreateGdPictureImageFromByteArray(byte [ ]) but this returns 0.
I've already tried this, but this doesn't work for me.No there is no other option to load PDF. The GdViewer control can be used in GUIless application. Just create a new GdViewer object like a GdPictureImaging one:
Dim oGdViewer as New GdViewer
I created a new c# project with following steps:
1) New Project -> Windows Service
2) Edit the static void Main() to:
Code: Select all
Service1 service = new Service1();
service.Start();
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
4) Add method to Service1
Code: Select all
public void Start()
{
GdViewer view = new GdPicture.GdViewer();
}
At debugging i get this Exception:
Code: Select all
System.InvalidOperationException was unhandled
Message="DragDrop registration did not succeed."
Source="System.Windows.Forms"
StackTrace:
at System.Windows.Forms.Control.SetAcceptDrops(Boolean accept)
at System.Windows.Forms.Control.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.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.IntCreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at GdPicture.GdViewer..ctor()
at GdPictureTestService.Service1.Start() in D:\Save\Projects\GdPictureTestService\GdPictureTestService\Service1.cs:Zeile 31.
at GdPictureTestService.Program.Main() in D:\Save\Projects\GdPictureTestService\GdPictureTestService\Program.cs:Zeile 13.
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Thanks in advance!
Regards,
prosigma