Exemplo n.º 1
0
        // POST
        public HttpResponseMessage Post(Web2PDFRequest req)
        {
            //UrlToPdf4Web.InitUrlTOPdf4CS();
            UrlToPdf4WebExec.InitUrlTOPdf4CS();

            //Web2PDFResponse rsp = UrlToPdf4Web.UrlToPDF(req);
            Web2PDFResponse rsp = UrlToPdf4WebExec.UrlToPDF(req);

            String jsonString          = JsonConvert.SerializeObject(rsp);
            HttpResponseMessage result = new HttpResponseMessage {
                Content = new StringContent(jsonString, Encoding.GetEncoding("UTF-8"), "application/json")
            };

            return(result);
        }
Exemplo n.º 2
0
        // GET
        public HttpResponseMessage Get(String WebURL, String HeaderPath, String FooterPath)
        {
            //UrlToPdf4Web.InitUrlTOPdf4CS();
            UrlToPdf4WebExec.InitUrlTOPdf4CS();

            Web2PDFRequest req = new Web2PDFRequest();

            req.WebURL     = WebURL;
            req.HeaderPath = HeaderPath;
            req.FooterPath = FooterPath;
            //Web2PDFResponse rsp = UrlToPdf4Web.UrlToPDF(req);
            Web2PDFResponse rsp = UrlToPdf4WebExec.UrlToPDF(req);

            String jsonString          = JsonConvert.SerializeObject(rsp);
            HttpResponseMessage result = new HttpResponseMessage {
                Content = new StringContent(jsonString, Encoding.GetEncoding("UTF-8"), "application/json")
            };

            return(result);
        }