Inheritance: Fonet.Pdf.PdfArray
Ejemplo n.º 1
0
        public PdfAnnotList MakeAnnotList()
        {
            var annotList = new PdfAnnotList(doc.NextObjectId());

            this.objects.Add(annotList);
            return(annotList);
        }
Ejemplo n.º 2
0
        public PdfAnnotList makeAnnotList()
        {
            PdfAnnotList obj = new PdfAnnotList(doc.NextObjectId());

            this.objects.Add(obj);
            return(obj);
        }
Ejemplo n.º 3
0
        public void StopRenderer() {
            fontSetup.AddToResources(new PdfFontCreator(pdfDoc), pdfDoc.getResources());
            pdfDoc.outputTrailer();

            pdfDoc = null;
            pdfResources = null;
            currentStream = null;
            currentAnnotList = null;
            currentPage = null;

            idReferences = null;
            currentFontName = String.Empty;
            currentFill = null;
            prevUnderlineColor = null;
            prevOverlineColor = null;
            prevLineThroughColor = null;
            fontSetup = null;
            fontInfo = null;
        }
Ejemplo n.º 4
0
        /**
        * render page into PDF
        *
        * @param page page to render
        */

        public void RenderPage(Page page) {
            BodyAreaContainer body;
            AreaContainer before, after, start, end;

            currentStream = this.pdfDoc.makeContentStream();
            body = page.getBody();
            before = page.getBefore();
            after = page.getAfter();
            start = page.getStart();
            end = page.getEnd();

            this.currentFontName = "";
            this.currentFontSize = 0;
            this.currentLetterSpacing = Single.NaN;

            currentStream.Write("BT\n");

            RenderBodyAreaContainer(body);

            if (before != null) {
                RenderAreaContainer(before);
            }

            if (after != null) {
                RenderAreaContainer(after);
            }

            if (start != null) {
                RenderAreaContainer(start);
            }

            if (end != null) {
                RenderAreaContainer(end);
            }
            CloseText();

            // Bug fix for issue 1823
            this.currentLetterSpacing = Single.NaN;

            float w = page.getWidth();
            float h = page.GetHeight();
            currentStream.Write("ET\n");

            currentPage = this.pdfDoc.makePage(
                this.pdfResources, currentStream,
                Convert.ToInt32(Math.Round(w/1000)),
                Convert.ToInt32(Math.Round(h/1000)), page);

            if (page.hasLinks() || currentAnnotList != null) {
                if (currentAnnotList == null) {
                    currentAnnotList = this.pdfDoc.makeAnnotList();
                }
                currentPage.SetAnnotList(currentAnnotList);

                ArrayList lsets = page.getLinkSets();
                foreach (LinkSet linkSet in lsets) {
                    linkSet.align();
                    String dest = linkSet.getDest();
                    int linkType = linkSet.getLinkType();
                    ArrayList rsets = linkSet.getRects();
                    foreach (LinkedRectangle lrect in rsets) {
                        currentAnnotList.Add(this.pdfDoc.makeLink(lrect.getRectangle(),
                                                                  dest, linkType).GetReference());
                    }
                }
                currentAnnotList = null;
            }
            else {
                // just to be on the safe side
                currentAnnotList = null;
            }

            // ensures that color is properly reset for blocks that carry over pages
            this.currentFill = null;
        }
Ejemplo n.º 5
0
 public PdfAnnotList makeAnnotList()
 {
     PdfAnnotList obj = new PdfAnnotList(doc.NextObjectId());
     this.objects.Add(obj);
     return obj;
 }