/**
 * Begins a marked content sequence. If property is <CODE>null</CODE> the mark will be of the type
 * <CODE>BMC</CODE> otherwise it will be <CODE>BDC</CODE>.
 * @param tag the tag
 * @param property the property
 * @param inline <CODE>true</CODE> to include the property in the content or <CODE>false</CODE>
 * to include the property in the resource dictionary with the possibility of reusing
 */
 public void BeginMarkedContentSequence(PdfName tag, PdfDictionary property, bool inline)
 {
     if (property == null) {
         content.Append(tag.GetBytes()).Append(" BMC").Append_i(separator);
         SetMcDepth(GetMcDepth() + 1);
         return;
     }
     content.Append(tag.GetBytes()).Append(' ');
     if (inline)
         property.ToPdf(writer, content);
     else {
         PdfObject[] objs;
         if (writer.PropertyExists(property))
             objs = writer.AddSimpleProperty(property, null);
         else
             objs = writer.AddSimpleProperty(property, writer.PdfIndirectReference);
         PdfName name = (PdfName)objs[0];
         PageResources prs = PageResources;
         name = prs.AddProperty(name, (PdfIndirectReference)objs[1]);
         content.Append(name.GetBytes());
     }
     content.Append(" BDC").Append_i(separator);
     SetMcDepth(GetMcDepth() + 1);
 }
 internal void AddTemplateReference(PdfIndirectReference template, PdfName name, float a, float b, float c, float d, float e, float f)
 {
     if (inText && autoControlTextBlocks) {
         EndText();
     }
     CheckWriter();
     PageResources prs = PageResources;
     name = prs.AddXObject(name, template);
     content.Append("q ");
     content.Append(a).Append(' ');
     content.Append(b).Append(' ');
     content.Append(c).Append(' ');
     content.Append(d).Append(' ');
     content.Append(e).Append(' ');
     content.Append(f).Append(" cm ");
     content.Append(name.GetBytes()).Append(" Do Q").Append_i(separator);
 }
Example #3
0
        /**
         * Adds a form XObject to this content.
         *
         * @param formXObj the form XObject
         * @param name the name of form XObject in content stream
         * @param a an element of the transformation matrix
         * @param b an element of the transformation matrix
         * @param c an element of the transformation matrix
         * @param d an element of the transformation matrix
         * @param e an element of the transformation matrix
         * @param f an element of the transformation matrix
         */
        public virtual void AddFormXObj(PdfStream formXObj, PdfName name, float a, float b, float c, float d, float e, float f) {
            CheckWriter();
            PdfWriter.CheckPdfIsoConformance(writer, PdfIsoKeys.PDFISOKEY_STREAM, formXObj);
            PageResources prs = PageResources;
            prs.AddXObject(name, writer.AddToBody(formXObj).IndirectReference);
            PdfArtifact artifact = null;
            if (IsTagged()) {
                if (inText)
                    EndText();
                artifact = new PdfArtifact();
                OpenMCBlock(artifact);
            }

            content.Append("q ");
            content.Append(a).Append(' ');
            content.Append(b).Append(' ');
            content.Append(c).Append(' ');
            content.Append(d).Append(' ');
            content.Append(e).Append(' ');
            content.Append(f).Append(" cm ");
            content.Append(name.GetBytes()).Append(" Do Q").Append_i(separator);

            if (IsTagged()) {
                CloseMCBlock(artifact);
            }
        }
Example #4
0
 /**
  * Set the rendering intent, possible values are: PdfName.ABSOLUTECOLORIMETRIC,
  * PdfName.RELATIVECOLORIMETRIC, PdfName.SATURATION, PdfName.PERCEPTUAL.
  * @param ri
  */
 virtual public void SetRenderingIntent(PdfName ri) {
     content.Append(ri.GetBytes()).Append(" ri").Append_i(separator);
 }
 internal void AddTemplateReference(PdfIndirectReference template, PdfName name, double a, double b, double c, double d, double e, double f) {
     if (inText && IsTagged()) {
         EndText();
     }
     CheckWriter();
     PageResources prs = PageResources;
     name = prs.AddXObject(name, template);
     content.Append("q ");
     content.Append(a).Append(' ');
     content.Append(b).Append(' ');
     content.Append(c).Append(' ');
     content.Append(d).Append(' ');
     content.Append(e).Append(' ');
     content.Append(f).Append(" cm ");
     content.Append(name.GetBytes()).Append(" Do Q").Append_i(separator);
 }