예제 #1
0
 /// <summary>
 /// Get the (x, y, zoom) location of |dest| in the destination page, if the destination is in [page /XYZ x y zoom] syntax.
 /// </summary>
 /// <param name="dest">Handle to the destination.</param>
 /// <param name="hasXVal">Out parameter; true if the x value is not null.</param>
 /// <param name="hasYVal">Out parameter; true if the y value is not null.</param>
 /// <param name="hasZoomVal">Out parameter; true if the zoom value is not null.</param>
 /// <param name="x">Out parameter; the x coordinate, in page coordinates.</param>
 /// <param name="y">Out parameter; the y coordinate, in page coordinates.</param>
 /// <param name="zoom">Out parameter; the zoom value.</param>
 /// <returns>Returns TRUE on successfully reading the /XYZ value.</returns>
 /// <remarks>
 /// Note the [x, y, zoom] values are only set if the corresponding hasXVal, hasYVal or hasZoomVal flags are true.
 /// FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFDest_GetLocationInPage(FPDF_DEST dest, FPDF_BOOL* hasXVal, FPDF_BOOL* hasYVal, FPDF_BOOL* hasZoomVal, FS_FLOAT* x, FS_FLOAT* y, FS_FLOAT* zoom);.
 /// </remarks>
 public bool FPDFDest_GetLocationInPage(FPDF_DEST dest, out bool hasXVal, out bool hasYVal, out bool hasZoomVal, out float x, out float y, out float zoom)
 {
     lock (_syncObject)
     {
         return(FPDFDest_GetLocationInPageStatic(dest, out hasXVal, out hasYVal, out hasZoomVal, out x, out y, out zoom));
     }
 }
예제 #2
0
 /// <summary>
 /// Experimental API.
 /// Get the view (fit type) specified by |dest|.
 /// </summary>
 /// <param name="dest">Handle to the destination.</param>
 /// <param name="pNumParams">Receives the number of view parameters, which is at most 4.</param>
 /// <param name="pParams">Buffer to write the view parameters. Must be at least 4 FS_FLOATs long.</param>
 /// <returns>Returns one of the PDFDEST_VIEW_* constants, PDFDEST_VIEW_UNKNOWN_MODE if |dest| does not specify a view.</returns>
 /// <remarks>
 /// FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFDest_GetView(FPDF_DEST dest, unsigned long* pNumParams, FS_FLOAT* pParams);.
 /// </remarks>
 public ulong FPDFDest_GetView(FPDF_DEST dest, ref ulong pNumParams, IntPtr pParams)
 {
     lock (_syncObject)
     {
         return(FPDFDest_GetViewStatic(dest, ref pNumParams, pParams));
     }
 }
예제 #3
0
 /// <summary>
 /// Get the page index of |dest|.
 /// </summary>
 /// <param name="document">Handle to the document.</param>
 /// <param name="dest">Handle to the destination.</param>
 /// <returns>Returns the 0-based page index containing |dest|. Returns -1 on error.</returns>
 /// <remarks>
 /// FPDF_EXPORT int FPDF_CALLCONV FPDFDest_GetDestPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest);.
 /// </remarks>
 public int FPDFDest_GetDestPageIndex(FPDF_DOCUMENT document, FPDF_DEST dest)
 {
     lock (_syncObject)
     {
         return(FPDFDest_GetDestPageIndexStatic(document, dest));
     }
 }
예제 #4
0
        public void FPDF_DEST_Constructor_Call2_Success()
        {
            var h = new FPDF_DEST(new IntPtr(1));

            Assert.IsTrue(h.IsValid);
        }
예제 #5
0
        public void FPDF_DEST_Constructor_Call1_Success()
        {
            var h = new FPDF_DEST();

            Assert.IsFalse(h.IsValid);
        }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PDFDestination"/> class.
 /// </summary>
 /// <param name="mainComponent">Main component where this destination belongs.</param>
 /// <param name="destinationHandle">Handle of associated destination.</param>
 public PDFDestination(PDFComponent mainComponent, FPDF_DEST destinationHandle)
 {
     _mainComponent     = mainComponent ?? throw new ArgumentNullException(nameof(mainComponent));
     _destinationHandle = destinationHandle;
 }