/// <summary> /// 拼接文档图片的下载地址 /// </summary> /// <param name="urlPrefix">文档信息中的url前缀</param> /// <param name="imgType">文档转换的图片类型</param> /// <param name="quality">需要的图片清晰度</param> /// <param name="pageNum">图片页码(从1开始计算)</param> /// <returns></returns> public static string GetPageUrl(string urlPrefix, NIMDocTranscodingImageType imgType, NIMDocTranscodingQuality quality, int pageNum) { var ptr = DocTransNativeMethods.nim_doctrans_get_page_url(urlPrefix, imgType, quality, pageNum); NimUtility.Utf8StringMarshaler marshaler = new NimUtility.Utf8StringMarshaler(); string url = marshaler.MarshalNativeToManaged(ptr) as string; GlobalAPI.FreeBuffer(ptr); return(url); }
internal static extern IntPtr nim_doctrans_get_page_url( [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(NimUtility.Utf8StringMarshaler))] string urlPrefix, NIMDocTranscodingImageType img_type, NIMDocTranscodingQuality quality, int page_num);