Пример #1
0
        public async Task <List <byte[]> > CreateThumbnailsAsync(byte[] file, int width, string pageNrs, ImageActionImageExtension imageFormat)
        {
            var res = await CustomHttp.postWrapper(
                new List <string> {
                "width", width.ToString(), "pageNrs", pageNrs, "imageFormat", Enum.GetName(typeof(ImageActionImageExtension), imageFormat)
            },
                new List <Tuple <byte[], string, string> > {
                new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
            },
                "Image/CreateThumbnails",
                _httpClient);

            // desirialization
            string respJson = System.Text.Encoding.Default.GetString(res);

            return(JsonConvert.DeserializeObject <List <byte[]> >(respJson));
        }
Пример #2
0
 public async Task <byte[]> CreateThumbnailAsync(byte[] file, int width, string pageNr, ImageActionImageExtension imageFormat)
 {
     return(await CustomHttp.postWrapper(
                new List <string> {
         "width", width.ToString(), "pageNr", pageNr, "imageFormat", Enum.GetName(typeof(ImageActionImageExtension), imageFormat)
     },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
     },
                "Image/CreateThumbnail",
                _httpClient));
 }