i have to try to load PDF file and then display on Thumbnail Control. so i have used GdPicturePDF cobject to load pdf file into thumbnail control using LoadFromGDPicturePDF().
but i got error on LoadFromGDPicturePDF() method of thumbnail control. i am using letest GdPicture.Net sdk.
below is my code
Code: Select all
string strPath="C:\\AAAAAAA\\Mg1.pdf";
thumbnailEx1.ThumbnailSize = new Size(130, 150);
thumbnailEx1.CheckBoxes = true;
thumbnailEx1.MultiSelect = true;
GdPicture.GdPicturePDF objPDF = new GdPicture.GdPicturePDF();
objPDF.SetLicenseNumber("XXXX");
objPDF.NewPDF();
if (objPDF.LoadFromFile(strPath, true) == GdPictureStatus.OK)
{
if (!objPDF.IsEncrypted())
{
thumbnailEx1.LoadFromGdPicturePDF(objPDF);
}
}
Object reference not set to an instance of an object.
at GdPicture.ThumbnailEx.LoadFromGdPicturePDF(GdPicturePDF PDF)
at ImageCenterApplication.AcquireProcess.BindThumbnail(String strPath) in D:\Projects\Application\Image\reProcess.cs:line 99
at ImageCenterApplication.AcquireProcess..ctor(String strFilePath) in D:\Projects\Application\Image\reProcess.cs:line 33
at ImageCenterApplication.di_acquireimage.btnAdd_Click(Object sender, EventArgs e) in D:\Projects\ImageCenterApplication\ImageCenterApplication\di_acquireimage.cs:line 43
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
i have also try to use GdPictureImaging class to load file into Thumbnail control but i got nothing inside GdPictureImaging object. i got 0 as GdPicture Imaging pointer inside m_CurrentImage variable.
Code: Select all
GdPicture.GdPictureImaging Imaging = new GdPicture.GdPictureImaging();
Imaging.SetLicenseNumberUpgrade("XXXX","XXXX");
int m_CurrentImage = Imaging.CreateGdPictureImageFromFile(strPath);
thumbnailEx1.LoadFromGdPictureImage(m_CurrentImage);
Please provide me solution with example.