示例#1
0
        public async Task <IceCatProduct> GetAsync(long productId)
        {
            var req = RequestEngine.CreateClient(_AccessConfig);

            var productXmlUrl = BuildXmlFileUrl($"{productId}.xml");

            var productXml = await RequestEngine.GetAsStringAsync(req, productXmlUrl);

            return(CustomXmlParser.Parse <IceCatProduct>(productXml, "Product"));
        }
        protected void ManipulatePdf(String dest)
        {
            PdfDocument pdfDoc = new PdfDocument(new PdfReader(SRC), new PdfWriter(dest));
            Document    doc    = new Document(pdfDoc);
            PdfAcroForm form   = PdfAcroForm.GetAcroForm(pdfDoc, true);

            // If no fields have been explicitly included, then all fields are flattened.
            // Otherwise only the included fields are flattened.
            form.FlattenFields();

            Rectangle pos = form.GetField("Name").GetWidgets()[0].GetRectangle().ToRectangle();

            // Custom parser gets position of the form field
            // to fill in the document with the parsed content.
            CustomXmlParser parser = new CustomXmlParser(doc, pos);

            parser.Parse("<root><div>Bruno <u>Lowagie</u></div></root>");

            pdfDoc.Close();
        }