Ejemplo n.º 1
0
 public async Task <byte[]> RepairDocumentAsync(byte[] file)
 {
     return(await CustomHttp.postWrapper(
                new List <string>() { },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
     },
                "PdfA/RepairDocument",
                _httpClient));
 }
Ejemplo n.º 2
0
 public async Task <byte[]> Merge2PdfsAsync(byte[] file1, byte[] file2)
 {
     return(await CustomHttp.postWrapper(
                new List <string> {
     },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file1, "file1", "pdf1.pdf"), new Tuple <byte[], string, string>(file2, "file2", "pdf2.pdf")
     },
                "Merge/Merge2Pdfs",
                _httpClient));
 }
Ejemplo n.º 3
0
 public async Task <byte[]> ConvertFileToPdfAsync(byte[] file, string fileName)
 {
     return(await CustomHttp.postWrapper(
                new List <string> {
         "fileName", fileName
     },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file, "file", fileName)
     },
                "Convert/ConvertFileToPdf",
                _httpClient));
 }
Ejemplo n.º 4
0
 public async Task <byte[]> TextStampAsync(byte[] file, string text, string pages, AlignX alignX, AlignY alignY)
 {
     return(await CustomHttp.postWrapper(
                new List <string> {
         "text", text, "pages", pages, "alignX", Enum.GetName(typeof(AlignX), alignX), "alignY", Enum.GetName(typeof(AlignY), alignY)
     },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
     },
                "Stamp/TextStamp",
                _httpClient));
 }
Ejemplo n.º 5
0
 public async Task <byte[]> CreatePdfAAsync(byte[] file)
 {
     return(await CustomHttp.postWrapper(
                new List <string> {
         "pdfCompliance", Enum.GetName(typeof(PdfAActionCompliance), PdfAActionCompliance.PdfA2b)
     },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
     },
                "PdfA/CreatePdfA",
                _httpClient));
 }
Ejemplo n.º 6
0
 public async Task <byte[]> UnlockDocumentAsync(byte[] file, string password)
 {
     return(await CustomHttp.postWrapper(
                new List <string> {
         "password", password
     },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
     },
                "PdfA/UnlockDocument",
                _httpClient));
 }
Ejemplo n.º 7
0
 public async Task <byte[]> ProtectDocumentAsync(byte[] file, string password, string permissions)
 {
     return(await CustomHttp.postWrapper(
                new List <string> {
         "password", password, "permissions", permissions
     },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
     },
                "PdfA/ProtectDocument",
                _httpClient));
 }
Ejemplo n.º 8
0
 public async Task <byte[]> RotateDocumentAsync(byte[] file, PdfRotateRotationType rotate)
 {
     return(await CustomHttp.postWrapper(
                new List <string> {
         "rotate", Enum.GetName(typeof(PdfRotateRotationType), rotate)
     },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
     },
                "PdfA/RotateDocument",
                _httpClient));
 }
Ejemplo n.º 9
0
 public async Task <byte[]> OptimizeByProfileAsync(byte[] file, OptimizeActionProfile profile)
 {
     return(await CustomHttp.postWrapper(
                new List <string> {
         "profile", Enum.GetName(typeof(OptimizeActionProfile), profile)
     },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
     },
                "Optimize/OptimizeByProfile",
                _httpClient));
 }
Ejemplo n.º 10
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));
 }
Ejemplo n.º 11
0
 public async Task <byte[]> ExtractPagesAsync(byte[] file, string pageNrs)
 {
     return(await CustomHttp.postWrapper(
                new List <string> {
         "pageNrs", pageNrs
     },
                new List <Tuple <byte[], string, string> > {
         new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
     },
                "Extract/ExtractPages",
                _httpClient));
 }
Ejemplo n.º 12
0
        public async Task <ReadBarcodesRes> ReadBarcodesByTypeAsync(byte[] file, BarcodeType barcodeType)
        {
            byte[] res = await CustomHttp.postWrapper(
                new List <string> {
                "barcodeType", barcodeType.ToString()
            },
                new List <Tuple <byte[], string, string> > {
                new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
            },
                "Barcode/ReadBarcodesByType",
                _httpClient);

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

            return(JsonConvert.DeserializeObject <ReadBarcodesRes>(respJson));
        }
Ejemplo n.º 13
0
        public async Task <ValidateRes> ValidateDocumentAsync(byte[] file, PdfAActionCompliance pdfCompliance)
        {
            byte[] res = await CustomHttp.postWrapper(
                new List <string> {
                "pdfCompliance", Enum.GetName(typeof(PdfAActionCompliance), pdfCompliance)
            },
                new List <Tuple <byte[], string, string> > {
                new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
            },
                "PdfA/ValidateDocument",
                _httpClient);

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

            return(JsonConvert.DeserializeObject <ValidateRes>(respJson));
        }
Ejemplo n.º 14
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));
        }
Ejemplo n.º 15
0
        public async Task <List <byte[]> > SplitRecurringAsync(byte[] file, int pageNr)
        {
            byte[] res = await CustomHttp.postWrapper(
                new List <string> {
                "pageNr", pageNr.ToString()
            },
                new List <Tuple <byte[], string, string> > {
                new Tuple <byte[], string, string>(file, "file", "pdf.pdf")
            },
                "Split/SplitRecurring",
                _httpClient);


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

            return(JsonConvert.DeserializeObject <List <byte[]> >(respJson));
        }