Пример #1
0
 internal void                    pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
 {
     for (int i = 0; i < Count; ++i)
     {
         base[i].pdfWriteToDocument(document, writer);
     }
 }
Пример #2
0
        internal override void                pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
        {
            writer.WriteDictionaryBegin();

            if (_title != null)
            {
                writer.WriteName("Title");          writer.WriteString(_title);
            }
            if (_author != null)
            {
                writer.WriteName("Author");         writer.WriteString(_author);
            }
            if (_subject != null)
            {
                writer.WriteName("Subject");        writer.WriteString(_subject);
            }
            if (_keywords != null)
            {
                writer.WriteName("Keywords");       writer.WriteString(_keywords);
            }
            if (_creator != null)
            {
                writer.WriteName("Creator");        writer.WriteString(_creator);
            }
            if (_producer != null)
            {
                writer.WriteName("Producer");       writer.WriteString(_producer);
            }
            { writer.WriteName("CreationDate");   writer.WriteDate(_creationDate); }
            { writer.WriteName("ModDate");        writer.WriteDate(_modDate); }

            writer.WriteDictionaryEnd();
        }
Пример #3
0
        internal override void                    pdfWriteToDocument(PdfDocumentWriter Document, PdfStreamWriter Writer)
        {
            Writer.WriteDictionaryBegin();

            Writer.WriteName("Type");
            Writer.WriteName("Pages");

            if (Parent != null)
            {
                Writer.WriteName("Parent");
                Writer.WriteReference(Document, Parent);
            }

            Writer.WriteName("Count");
            Writer.WriteInteger(_count);

            Writer.WriteName("Kids");
            Writer.WriteArrayBegin();

            for (int i = 0; i < _pages.Count; ++i)
            {
                Writer.WriteReference(Document, _pages[i]);
            }

            Writer.WriteArrayEnd();

            Writer.WriteDictionaryEnd();
        }
Пример #4
0
        internal override void            pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
        {
            writer.WriteDictionaryBegin();
            {
                writer.WriteName("Type");
                writer.WriteName("XObject");

                writer.WriteName("Subtype");
                writer.WriteName("Image");

                writer.WriteName("Width");
                writer.WriteInteger(_width);

                writer.WriteName("Height");
                writer.WriteInteger(_height);

                writer.WriteName("ColorSpace");
                writer.WriteName("DeviceRGB");

                writer.WriteName("BitsPerComponent");
                writer.WriteInteger(_bitsPerComponent);

                writer.WriteName("Filter");
                writer.WriteName("DCTDecode");

                writer.WriteName("Interpolate");
                writer.WriteBoolean(true);

                writer.WriteName("Length");
                writer.WriteInteger(_imageDataLength);
            }
            writer.WriteDictionaryEnd();
            writer.WriteStream(_imageData, _imageDataLength);
        }
Пример #5
0
 internal override void                    pdfAddToDocument(PdfDocumentWriter document)
 {
     for (var curContent = this._content; curContent != null; curContent = curContent.Parent)
     {
         document.AddObj(curContent);
     }
 }
Пример #6
0
 internal override void                    pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
 {
     if (_hexadecimal)
     {
         writer.WriteStringHex(_value);
     }
     else
     {
         writer.WriteStringRaw(_value);
     }
 }
Пример #7
0
        internal override void                pdfWriteToDocument(PdfDocumentWriter Document, PdfStreamWriter Writer)
        {
            Writer.WriteDictionaryBegin();
            {
                Writer.WriteName("Type");
                Writer.WriteName("Font");

                Writer.WriteName("Subtype");
                Writer.WriteName("Type1");

                Writer.WriteName("BaseFont");
                Writer.WriteName(FontName);

                Writer.WriteName("Encoding");
                Writer.WriteName("WinAnsiEncoding");
            }
            Writer.WriteDictionaryEnd();
        }
Пример #8
0
        internal override void                                pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
        {
            if (document.CompressContent)
            {
                using (var compressStream = new StreamBuffer()) {
                    string Filter = "FlateDecode";

                    using (Stream CompressWriter = PdfFilter.GetCompressor(Filter, compressStream))
                        CompressWriter.Write(_dataStream.GetBuffer(), 0, (int)_dataStream.Length);

                    _writeContent(writer, Filter, compressStream);
                }
            }
            else
            {
                _writeContent(writer, null, _dataStream);
            }
        }
Пример #9
0
        internal override void                                pdfAddToDocument(PdfDocumentWriter writer)
        {
            if (_textMode)
            {
                opEndText();
            }

            _locked = true;

            if (Parent != null)
            {
                writer.AddObj(Parent);
            }

            for (int i = 0; i < _resources.Count; ++i)
            {
                if (_resources[i].Resource is PdfObject obj)
                {
                    writer.AddObj(obj);
                }
            }
        }
Пример #10
0
        internal override void                pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
        {
            writer.WriteDictionaryBegin();
            writer.WriteName("Type");
            writer.WriteName("Catalog");

            if (_pages != null)
            {
                writer.WriteName("Pages");
                writer.WriteReference(document, _pages);
            }

            writer.WriteName("ViewerPreferences");
            writer.WriteDictionaryBegin();
            writer.WriteName("PrintScaling");
            writer.WriteName("None");
            writer.WriteDictionaryEnd();

            writer.WriteName("PageLayout");
            writer.WriteName("SinglePage");

            writer.WriteDictionaryEnd();
        }
Пример #11
0
 internal override void                    pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
 {
     throw new PdfExceptionWriter("Can't write PdfToken.");
 }
Пример #12
0
 internal override void                    pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
 {
     writer.WriteInteger(_value);
 }
Пример #13
0
        internal override void                    pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
        {
            writer.WriteDictionaryBegin();
            {
                writer.WriteName("Type");
                writer.WriteName("Page");

                writer.WriteName("Parent");
                writer.WriteReference(document, Parent);

                writer.WriteName("MediaBox");
                writer.WriteArrayBegin();
                {
                    writer.WriteInteger(0);
                    writer.WriteInteger(0);
                    writer.WriteNumber(_pageSize.width.pnts);
                    writer.WriteNumber(_pageSize.height.pnts);
                }
                writer.WriteArrayEnd();

                writer.WriteName("CropBox");
                writer.WriteRectangle(_cropBox);

                if (_bleedBox != _cropBox)
                {
                    writer.WriteName("BleedBox");
                    writer.WriteRectangle(_bleedBox);
                }

                if (_trimBox != _cropBox)
                {
                    writer.WriteName("TrimBox");
                    writer.WriteRectangle(_trimBox);
                }

                if (_artBox != _cropBox)
                {
                    writer.WriteName("ArtBox");
                    writer.WriteRectangle(_artBox);
                }

                writer.WriteName("Contents");
                writer.WriteArrayBegin();

                for (var curContent = this._content; curContent != null; curContent = curContent.Parent)
                {
                    writer.WriteReference(document.GetReference(curContent));
                }

                writer.WriteArrayEnd();


                writer.WriteName("Resources");
                writer.WriteDictionaryBegin();
                {
                    writer.WriteName("ProcSet");
                    writer.WriteArrayBegin();
                    {
                        writer.WriteName("PDF");
                        writer.WriteName("Text");
                        writer.WriteName("ImageB");
                        writer.WriteName("ImageC");
                    }
                    writer.WriteArrayEnd();

                    _content.Resources.pdfWriteResources(document, writer);
                }
                writer.WriteDictionaryEnd();
            }
            writer.WriteDictionaryEnd();
        }
Пример #14
0
 internal override void                    pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
 {
     writer.WriteNull();
 }
Пример #15
0
 internal override void                    pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
 {
     writer.WriteReference(document, Value);
 }
 internal override void                    pdfWriteToDocument(PdfDocumentWriter document, PdfStreamWriter writer)
 {
     writer.WriteDictionaryBegin();
     _children.pdfWriteToDocument(document, writer);
     writer.WriteDictionaryEnd();
 }
Пример #17
0
 internal virtual void                    pdfAddToDocument(PdfDocumentWriter documentWriter)
 {
 }
Пример #18
0
 internal abstract void                    pdfWriteToDocument(PdfDocumentWriter Document, PdfStreamWriter Writer);