The title ba i s"GdPicturePro5S. The message is "Unexpected error was rasied: File no Found". The return error code is 205 - "PDFunexpected error".
If I continue stepping through the code, the page count is read correctly. The next section of code display pages and writes them to a Tif file. I get the same error message when I call the DisplayFrame function with the selected page. If I select OK for all the message boxes, the extraction code works correctly and a tif file is created with the correct pages.
I have include the code segment
- Code: Select all
void CImageclass::convertpdf(char *a, char *b)
{
int nStart, nEnd;
C_GdViewer m_viewer;
C_Imaging m_imaging;
if (!m_viewer.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW | WS_HSCROLL | WS_VSCROLL,
CRect(100, 100, 100, 100), this, AFX_IDW_PANE_FIRST, NULL))
{
return ;
}
if (!m_imaging.Create(NULL, NULL, WS_CHILD | WS_BORDER,
CRect(300, 500, 300, 500), this, AFX_IDW_PANE_FIRST, NULL))
{
return ;
}
m_viewer.SetLicenseNumber ("XXXXX");
m_imaging.SetLicenseNumber("XXXXX");
m_viewer.SetLockControl(TRUE);
int long i = m_viewer.DisplayFromPdfFile(a, NULL);
int nCount = m_viewer.GetPageCount();
nStart = 2;
nEnd = 5;
for(int npage=nStart;npage<=nEnd;npage++)
{
//Convert PDF to Multipage TIF
m_viewer .DisplayFrame(npage);
m_imaging.SetNativeImage(m_imaging.CreateClonedImage(m_viewer.GetNativeImage()));
m_imaging.ConvertTo1Bpp();
if (npage == nStart)
{
m_imaging.TiffSaveAsNativeMultiPage(b, 4);
}
else
{
m_imaging.TiffAddToNativeMultiPage(m_imaging.GetNativeImage());
m_imaging.CloseNativeImage();
}
}
m_imaging.TiffCloseNativeMultiPage();
}
Thank you
