Exemple #1
0
        internal ContentStream(ResourceDict resources)
        {
            _resources = resources;
            _buffer    = new MemoryStream();
            _buffer.WriteByte(0x78);
            _buffer.WriteByte(0xDA);
            DeflateStream deflateStream = new DeflateStream(_buffer, CompressionMode.Compress, true);

            _contentWriter = new StreamWriter(deflateStream, Document.GetCodepage1252());
            _dict          = new GeneralDict();
        }
Exemple #2
0
        internal Page(Document document, Reference parent, float width, float height)
        {
            _dict = new GeneralDict("Page");
            _dict.Add("Parent", parent);
            _dict.Add("MediaBox", new List <float> {
                0, 0, width, height
            });

            ResourceDict resources    = new ResourceDict(document);
            Reference    resourcesRef = document.CreateReference(resources);

            _dict.Add("Resources", resourcesRef);

            Contents = new ContentStream(resources);
            Reference contentsRef = document.CreateReference(Contents);

            _dict.Add("Contents", contentsRef);
        }