Пример #1
0
        public void Open(string aFileName)
        {
            if (m_bDisposed)
            {
                throw new ApplicationException("PDFDoc.OpenFromIStream");
            }

            if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_ReadDocumentW(m_Doc, aFileName, 0)))
            {
                throw new ApplicationException("PDFDoc.Open.PXCV_ReadDocumentW");
            }
        }
Пример #2
0
        public void ReleaseCachedData(int flags)
        {
            if (m_bDisposed)
            {
                throw new ApplicationException("PDFDoc.ReleaseCachedData");
            }

            if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_ReleaseCachedData(m_Doc, flags)))
            {
                throw new ApplicationException("PDFDoc.ReleaseCachedData.PXCV_ReleaseCachedData");
            }
        }
Пример #3
0
 public void Init(string aKey, string aDevCode)
 {
     if (!m_bDisposed)
     {
         throw new ApplicationException("PDFLib.Init");
     }
     if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_Init(out m_Doc, aKey, aDevCode)))
     {
         throw new ApplicationException("PDFDoc.Init.PXCV_Init");
     }
     m_bDisposed = false;
 }
Пример #4
0
 public void Init(string aKey, string aDevCode)
 {
     if (!b)
     {
         throw new ApplicationException("PDFLib.Init");
     }
     if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_Init(out this.m_a, aKey, aDevCode)))
     {
         throw new ApplicationException("PDFDoc.Init.PXCV_Init");
     }
     b = false;
 }
Пример #5
0
        public int GetPagesCount()
        {
            int count = 0;

            if (b)
            {
                throw new ApplicationException("PDFDoc.GetPagesCount");
            }
            if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_GetPagesCount(this.m_a, out count)))
            {
                throw new ApplicationException("PDFDoc.OpenFromPXCV_GetPageDimensions");
            }
            return(count);
        }
Пример #6
0
        public int GetPagesCount()
        {
            int cnt = 0;

            if (m_bDisposed)
            {
                throw new ApplicationException("PDFDoc.GetPagesCount");
            }
            if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_GetPagesCount(m_Doc, out cnt)))
            {
                throw new ApplicationException("PDFDoc.OpenFromPXCV_GetPageDimensions");
            }

            return(cnt);
        }
Пример #7
0
        public void DrawPageToDIBSection(IntPtr hBaseDC, int pn, Color aBkgColor, PXCV_Lib36.PXV_CommonRenderParameters aCommonRenderParams, out Bitmap aBitmap)
        {
            aBitmap = null;
            if (m_bDisposed)
            {
                throw new ApplicationException("PDFDoc.DrawPageToDIBSection");
            }
            IntPtr hBitmap   = IntPtr.Zero;
            int    backcolor = aBkgColor.ToArgb();

            if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_DrawPageToDIBSection(m_Doc, pn, ref aCommonRenderParams, hBaseDC, backcolor, ref hBitmap, IntPtr.Zero, 0)))
            {
                throw new ApplicationException("PDFDoc.DrawPageToDIBSection.PXCV_DrawPageToDIBSection");
            }
            aBitmap = Image.FromHbitmap(hBitmap);
            DeleteObject(hBitmap);
        }