/// <summary>
 /// Experimental API. Fetch the start char index and char count for a link.
 /// </summary>
 /// <param name="link_page">Handle returned by FPDFLink_LoadWebLinks.</param>
 /// <param name="link_index">Zero-based index for the link.</param>
 /// <param name="start_char_index">Pointer to int receiving the start char index.</param>
 /// <param name="char_count">Pointer to int receiving the char count.</param>
 /// <returns>On success, return TRUE and fill in |start_char_index| and |char_count|.
 /// if |link_page| is invalid or if |link_index| does not correspond to a valid link,
 /// then return FALSE and the out parameters remain unmodified.</returns>
 /// <remarks>
 /// FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetTextRange(FPDF_PAGELINK link_page, int link_index, int* start_char_index, int* char_count);.
 /// </remarks>
 public bool FPDFLink_GetTextRange(FPDF_PAGELINK link_page, int link_index, ref int start_char_index, ref int char_count)
 {
     lock (_syncObject)
     {
         return(FPDFLink_GetTextRangeStatic(link_page, link_index, ref start_char_index, ref char_count));
     }
 }
 /// <summary>
 /// Release resources used by weblink feature.
 /// </summary>
 /// <param name="link_page">Handle returned by FPDFLink_LoadWebLinks.</param>
 /// <remarks>
 /// FPDF_EXPORT void FPDF_CALLCONV FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page);.
 /// </remarks>
 public void FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page)
 {
     lock (_syncObject)
     {
         FPDFLink_CloseWebLinksStatic(link_page);
     }
 }
 /// <summary>
 /// Count number of rectangular areas for the link.
 /// </summary>
 /// <param name="link_page">Handle returned by FPDFLink_LoadWebLinks.</param>
 /// <param name="link_index">Zero-based index for the link.</param>
 /// <returns>Number of rectangular areas for the link.  If |link_index| does not correspond to a valid link, then 0 is returned.</returns>
 /// <remarks>
 /// FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountRects(FPDF_PAGELINK link_page, int link_index);.
 /// </remarks>
 public int FPDFLink_CountRects(FPDF_PAGELINK link_page, int link_index)
 {
     lock (_syncObject)
     {
         return(FPDFLink_CountRectsStatic(link_page, link_index));
     }
 }
 /// <summary>
 /// Fetch the boundaries of a rectangle for a link.
 /// </summary>
 /// <param name="link_page">Handle returned by FPDFLink_LoadWebLinks.</param>
 /// <param name="link_index">Zero-based index for the link.</param>
 /// <param name="rect_index">Zero-based index for a rectangle.</param>
 /// <param name="left">Pointer to a double value receiving the rectangle left boundary.</param>
 /// <param name="top">Pointer to a double value receiving the rectangle top boundary.</param>
 /// <param name="right">Pointer to a double value receiving the rectangle right boundary.</param>
 /// <param name="bottom">Pointer to a double value receiving the rectangle bottom boundary.</param>
 /// <returns>On success, return TRUE and fill in |left|, |top|, |right|, and |bottom|.
 /// If |link_page| is invalid or if |link_index| does not correspond to a valid link, then return FALSE,
 /// and the out parameters remain unmodified.</returns>
 /// <remarks>
 /// FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page, int link_index, int rect_index, double* left, double* top, double* right, double* bottom);.
 /// </remarks>
 public bool FPDFLink_GetRect(FPDF_PAGELINK link_page, int link_index, int rect_index, ref double left, ref double top, ref double right, ref double bottom)
 {
     lock (_syncObject)
     {
         return(FPDFLink_GetRectStatic(link_page, link_index, rect_index, ref left, ref top, ref right, ref bottom));
     }
 }
 /// <summary>
 /// Fetch the URL information for a detected web link.
 /// </summary>
 /// <param name="link_page">Handle returned by FPDFLink_LoadWebLinks.</param>
 /// <param name="link_index">Zero-based index for the link.</param>
 /// <param name="buffer">A unicode buffer for the result.</param>
 /// <param name="buflen">Number of 16-bit code units (not bytes) for the buffer, including an additional terminator.</param>
 /// <returns>If |buffer| is NULL or |buflen| is zero, return the number of 16-bit code units (not bytes) needed to buffer the result
 /// (an additional terminator is included in this count).
 /// Otherwise, copy the result into |buffer|, truncating at |buflen| if the result is too large to fit,
 /// and return the number of 16-bit code units actually copied into the buffer
 /// (the additional terminator is also included in this count).
 /// If |link_index| does not correspond to a valid link, then the result is an empty string.</returns>
 /// <remarks>
 /// FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetURL(FPDF_PAGELINK link_page, int link_index, unsigned short* buffer, int buflen);.
 /// </remarks>
 public int FPDFLink_GetURL(FPDF_PAGELINK link_page, int link_index, IntPtr buffer, int buflen)
 {
     lock (_syncObject)
     {
         return(FPDFLink_GetURLStatic(link_page, link_index, buffer, buflen));
     }
 }
 /// <summary>
 /// Count number of detected web links.
 /// </summary>
 /// <param name="link_page">Handle returned by FPDFLink_LoadWebLinks.</param>
 /// <returns>Number of detected web links.</returns>
 /// <remarks>
 /// FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountWebLinks(FPDF_PAGELINK link_page);.
 /// </remarks>
 public int FPDFLink_CountWebLinks(FPDF_PAGELINK link_page)
 {
     lock (_syncObject)
     {
         return(FPDFLink_CountWebLinksStatic(link_page));
     }
 }
예제 #7
0
 public static string FPDFLink_GetURL(FPDF_PAGELINK link_page, int link_index) => GetUtf16String((ref byte buffer, int length)
                                                                                                 => FPDFLink_GetURL(link_page, link_index, ref buffer, length), sizeof(ushort), true);
예제 #8
0
        public void FPDF_PAGELINK_Constructor_Call2_Success()
        {
            var h = new FPDF_PAGELINK(new IntPtr(1));

            Assert.IsTrue(h.IsValid);
        }
예제 #9
0
        public void FPDF_PAGELINK_Constructor_Call1_Success()
        {
            var h = new FPDF_PAGELINK();

            Assert.IsFalse(h.IsValid);
        }