/// <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); }
/// <summary> /// 拼接文档源的下载地址 /// </summary> /// <param name="urlPrefix">文档信息中的url前缀</param> /// <param name="fileType">文档源类型</param> /// <returns></returns> public static string GetSourceFileUrl(string urlPrefix, NIMDocTranscodingFileType fileType) { var ptr = DocTransNativeMethods.nim_doctrans_get_source_file_url(urlPrefix, fileType); NimUtility.Utf8StringMarshaler marshaler = new NimUtility.Utf8StringMarshaler(); string url = marshaler.MarshalNativeToManaged(ptr) as string; GlobalAPI.FreeBuffer(ptr); return(url); }