Error when try to view image files (Tiff or BMP)
Posted: Wed Mar 22, 2017 2:28 am
Hi Guys
windows 10 ,framework 4.6.1 , win 64 dll ver 6.0.319.0
Im using the following to view a Tiff or bmp file in the viewer but am getting errors
public void OpenPdfDoc(string pFileName, string Display = "All")
{
if (pFileName != "")
{
try
{
axPXV_Control1.Inst.Settings["Docs.AutoSyncDocPanesLayouts"].v = false;
axPXV_Control1.Inst.FireAppPrefsChanged(PDFXEdit.PXV_AppPrefsChanges.PXV_AppPrefsChange_Documents);
PDFXEdit.IPXV_MainFrame secondMainFrame = axPXV_Control1.Inst.MainFrm[SupportClass.FrameCount];
secondMainFrame.OpenDocFrom(pxcInst.OpenDocumentFromFile(@CurrentPdfFilePath.ToString(), null));
if (axPXV_Control1.Doc != null)
{ PageCount = axPXV_Control1.Doc.CoreDoc.Pages.Count;
axPXV_Control1.Doc.ActiveView.Panes.Show(axPXV_Control1.Doc.ActiveView.PageThumbsView);
PDFXEdit.IUIX_ScrollContainer scrollContainer = GetParentScrollContainer(axPXV_Control1.Doc.ActiveView.PageThumbsView.Obj);
PDFXEdit.IUIX_CmdLine line = scrollContainer.CmdPaneTop[0];
PDFXEdit.IUIX_CmdBar bar = line[0];
PDFXEdit.IUIX_CmdItem item = bar.FindFirstItemByCmdName("cmd.delete");
item.Delete();
axPXV_Control1.Doc.ActiveView.Panes.Hide(axPXV_Control1.Doc.ActiveView.PagesView);
}
// axPXV_Control1.Inst.ExecUICmd("cmd.zoom.level.fitPage");
}
catch (Exception ex)
{
ShowErrorMessage(System.Runtime.InteropServices.Marshal.GetHRForException(ex));
}
}
}
The error occurs at secondMainFrame.OpenDocFrom(pxcInst.OpenDocumentFromFile(@CurrentPdfFilePath.ToString(), null));
ex is Exception from HRESULT: 0x82140002
PDF files dont cause any issues
windows 10 ,framework 4.6.1 , win 64 dll ver 6.0.319.0
Im using the following to view a Tiff or bmp file in the viewer but am getting errors
public void OpenPdfDoc(string pFileName, string Display = "All")
{
if (pFileName != "")
{
try
{
axPXV_Control1.Inst.Settings["Docs.AutoSyncDocPanesLayouts"].v = false;
axPXV_Control1.Inst.FireAppPrefsChanged(PDFXEdit.PXV_AppPrefsChanges.PXV_AppPrefsChange_Documents);
PDFXEdit.IPXV_MainFrame secondMainFrame = axPXV_Control1.Inst.MainFrm[SupportClass.FrameCount];
secondMainFrame.OpenDocFrom(pxcInst.OpenDocumentFromFile(@CurrentPdfFilePath.ToString(), null));
if (axPXV_Control1.Doc != null)
{ PageCount = axPXV_Control1.Doc.CoreDoc.Pages.Count;
axPXV_Control1.Doc.ActiveView.Panes.Show(axPXV_Control1.Doc.ActiveView.PageThumbsView);
PDFXEdit.IUIX_ScrollContainer scrollContainer = GetParentScrollContainer(axPXV_Control1.Doc.ActiveView.PageThumbsView.Obj);
PDFXEdit.IUIX_CmdLine line = scrollContainer.CmdPaneTop[0];
PDFXEdit.IUIX_CmdBar bar = line[0];
PDFXEdit.IUIX_CmdItem item = bar.FindFirstItemByCmdName("cmd.delete");
item.Delete();
axPXV_Control1.Doc.ActiveView.Panes.Hide(axPXV_Control1.Doc.ActiveView.PagesView);
}
// axPXV_Control1.Inst.ExecUICmd("cmd.zoom.level.fitPage");
}
catch (Exception ex)
{
ShowErrorMessage(System.Runtime.InteropServices.Marshal.GetHRForException(ex));
}
}
}
The error occurs at secondMainFrame.OpenDocFrom(pxcInst.OpenDocumentFromFile(@CurrentPdfFilePath.ToString(), null));
ex is Exception from HRESULT: 0x82140002
PDF files dont cause any issues