Example #1
0
 public void OpenFromMemory(byte[] pMemory, UInt32 size, Int32 flags)
 {
     if (m_bDisposed)
     {
         throw new ApplicationException("PDFDoc.OpenFromMemory");
     }
     if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_ReadDocumentFromMemory(m_Doc, pMemory, size, flags)))
     {
         throw new ApplicationException("PDFDoc.OpenFromPXCV_ReadDocumentFromMemory");
     }
 }
Example #2
0
 public void GetPageDimensions(int pn, out double w, out double h)
 {
     if (m_bDisposed)
     {
         throw new ApplicationException("PDFDoc.GetPageDimensions");
     }
     if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_GetPageDimensions(m_Doc, pn, out w, out h)))
     {
         throw new ApplicationException("PDFDoc.OpenFromPXCV_GetPageDimensions");
     }
 }
Example #3
0
 public void Delete()
 {
     if (!m_bDisposed)
     {
         if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_Delete(m_Doc)))
         {
             throw new ApplicationException("PDFDoc.Delete.PXCV_Delete");
         }
         m_bDisposed = true;
     }
 }
Example #4
0
 public void OpenFromIStream(IStream aIStream, Int32 flags)
 {
     if (m_bDisposed)
     {
         throw new ApplicationException("PDFDoc.OpenFromIStream");
     }
     if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_ReadDocumentFromIStream(m_Doc, aIStream, flags)))
     {
         throw new ApplicationException("PDFDoc.OpenFromPXCV_ReadDocumentFromIStream");
     }
 }
Example #5
0
 public void OpenFromMemory(byte[] pMemory, uint size, int flags)
 {
     if (b)
     {
         throw new ApplicationException("PDFDoc.OpenFromMemory");
     }
     if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_ReadDocumentFromMemory(this.m_a, pMemory, size, flags)))
     {
         throw new ApplicationException("PDFDoc.OpenFromPXCV_ReadDocumentFromMemory");
     }
 }
Example #6
0
 public void Open(string aFileName)
 {
     if (b)
     {
         throw new ApplicationException("PDFDoc.OpenFromIStream");
     }
     if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_ReadDocumentW(this.m_a, aFileName, 0)))
     {
         throw new ApplicationException("PDFDoc.Open.PXCV_ReadDocumentW");
     }
 }
Example #7
0
 public void OpenFromIStream(IStream aIStream, int flags)
 {
     if (b)
     {
         throw new ApplicationException("PDFDoc.OpenFromIStream");
     }
     if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_ReadDocumentFromIStream(this.m_a, aIStream, flags)))
     {
         throw new ApplicationException("PDFDoc.OpenFromPXCV_ReadDocumentFromIStream");
     }
 }
Example #8
0
 public void DrawPageToDC(IntPtr hDC, int pn, PXCV_Lib36.PXV_CommonRenderParameters aCommonRenderParams)
 {
     if (b)
     {
         throw new ApplicationException("PDFDoc.DrawPage");
     }
     if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_DrawPageToDC(this.m_a, pn, hDC, ref aCommonRenderParams)))
     {
         throw new ApplicationException("PDFDoc.DrawPageToDC.PXCV_DrawPageToDC");
     }
 }
Example #9
0
 public void Delete()
 {
     if (!b)
     {
         if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_Delete(this.m_a)))
         {
             throw new ApplicationException("PDFDoc.Delete.PXCV_Delete");
         }
         b = true;
     }
 }
Example #10
0
 public void ReleaseCachedData(int flags)
 {
     if (b)
     {
         throw new ApplicationException("PDFDoc.ReleaseCachedData");
     }
     if (PXCV_Error.IS_DS_FAILED(PXCV_Lib36.PXCV_ReleaseCachedData(this.m_a, flags)))
     {
         throw new ApplicationException("PDFDoc.ReleaseCachedData.PXCV_ReleaseCachedData");
     }
 }
Example #11
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");
     }
 }
Example #12
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;
 }
Example #13
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;
 }
Example #14
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);
        }
Example #15
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);
        }
Example #16
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);
        }