Esempio n. 1
0
        private org.pdfclown.documents.contents.xObjects.XObject GetPdfLogo(string path)
        {
            org.pdfclown.files.File pdfFile = new org.pdfclown.files.File(path);

            var logo = pdfFile.Document.Pages[0].ToXObject(this.Document);

            return(logo);
        }
Esempio n. 2
0
        public Byte[] Run(string pathToPdf, Dictionary<string, string> mapper, object data)
        {
            org.pdfclown.files.File file = new org.pdfclown.files.File(pathToPdf);
            Document document = file.Document;

            Form form = document.Form;
            if (form.Exists())
            {
                FillForm(form, mapper, data);
            }

            return Serialize(file);
        }
Esempio n. 3
0
        public List <Transaction> DoWork()
        {
            var file   = new org.pdfclown.files.File(docPath);
            var page11 = file.Document.Pages.Count >= 11
                             ? file.Document.Pages[11]
                             : null;
            var data  = page11.Contents.ContentContext.Contents[page11.Contents.ContentContext.Contents.Count - 1];
            var data2 = page11.Contents[page11.Contents.Count - 1];

            //org.pdfclown.objects.
            //GraphicsObject, ContentOjbect, OperationsObject("Show Text" || "Tj")
            //var textExtractor = new org.pdfclown.tools.TextExtractor();

            throw new NotImplementedException("Still need to implement Reader!");
        }
Esempio n. 4
0
        public DanfeDocumento(DanfeViewModel model, float margem)
        {
            Margem   = margem;
            _File    = new org.pdfclown.files.File();
            Document = _File.Document;
            Model    = model;
            Size     = new SizeF(Utils.Mm2Pu(A4Tamanho.Width), Utils.Mm2Pu(A4Tamanho.Height));

            Font     = new org.pdfclown.documents.contents.fonts.StandardType1Font(Document, org.pdfclown.documents.contents.fonts.StandardType1Font.FamilyEnum.Times, false, false);
            FontBold = new org.pdfclown.documents.contents.fonts.StandardType1Font(Document, org.pdfclown.documents.contents.fonts.StandardType1Font.FamilyEnum.Times, true, false);

            InnerRect = new RectangleF(0, 0, Utils.Mm2Pu(A4Tamanho.Width), Utils.Mm2Pu(A4Tamanho.Height)).GetPaddedRectangleMm(5);
            Paginas   = new List <DanfePagina>();

            AdicionarMetadata();

            FoiGerado = false;
        }
Esempio n. 5
0
        public DanfeDocumento(DanfeViewModel model, float margem)
        {
            Margem = margem;
            _File = new org.pdfclown.files.File();
            Document = _File.Document;
            Model = model;
            Size = new SizeF(Utils.Mm2Pu(A4Tamanho.Width), Utils.Mm2Pu(A4Tamanho.Height));

            Font = new StandardType1Font(Document, StandardType1Font.FamilyEnum.Times, false, false);
            FontBold = new StandardType1Font(Document, StandardType1Font.FamilyEnum.Times, true, false);

            InnerRect = new RectangleF(0, 0, Utils.Mm2Pu(A4Tamanho.Width), Utils.Mm2Pu(A4Tamanho.Height)).GetPaddedRectangleMm(5);
            Paginas = new List<DanfePagina>();

            AdicionarMetadata();

            FoiGerado = false;
        }
Esempio n. 6
0
        private void onDrop_doc(object sender, DragEventArgs e)
        {
            if (sender.GetType() == typeof(ListView))
            {
                ListView lv = (ListView)sender;

                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

                if (files.Length == 1)
                {
                    if (Path.GetExtension(files[0]).ToLower().Contains(".pdf"))
                    {
                        //This only seems to work with
                        using (org.pdfclown.files.File Cfile = new org.pdfclown.files.File(files[0]))
                        {
                            org.pdfclown.documents.Document document = Cfile.Document;
                            org.pdfclown.documents.Pages    Cpages   = document.Pages;
                            foreach (org.pdfclown.documents.Page Cpage in Cpages)
                            {
                                Renderer renderer  = new Renderer();
                                SizeF    imageSize = new SizeF();
                                imageSize.Height = Cpage.Size.Height / 3;
                                imageSize.Width  = Cpage.Size.Width / 3;
                                Image Cimage = renderer.Render(Cpage, imageSize);
                                imageList1.Images.Add(Cimage);
                            }
                        }
                    }

                    else
                    {
                        MessageBox.Show("Pleas only drop PDF's here.");
                    }

                    lv_files_doc.View = View.LargeIcon;
                    lv_files_doc.Columns.Add("File");
                    lv_files_doc.Columns[0].Width = lv_files_doc.Width - 4;
                    lv_files_doc.HeaderStyle      = ColumnHeaderStyle.None;
                    imageList1.ImageSize          = new Size(180, 128);
                    lv_files_doc.Scrollable       = true;

                    lv_files_doc.LargeImageList = imageList1;

                    for (int j = 0; j < this.imageList1.Images.Count; j++)
                    {
                        ListViewItem item = new ListViewItem();
                        item.ImageIndex = j;
                        lv.Items.Add(item);
                    }

                    lv.Items[0].Selected = true;
                }
                //process single file


                else
                {
                    MessageBox.Show("Please drop only one file.");
                    return;
                }

                if (lv.Items.Count != 0)
                {
                    lblDrag_pdf.Visible = false;
                }
            }
        }
Esempio n. 7
0
        private org.pdfclown.documents.contents.xObjects.XObject GetPdfLogo(String path)
        {
            org.pdfclown.files.File pdfFile = new org.pdfclown.files.File(path);

            var logo = pdfFile.Document.Pages[0].ToXObject(this.Document);
            return logo;
        }