private void addToPropertiesAndBeginLayer(IPdfOCG layer) { PdfName name = resources.addProperties(layer.getPdfObject()); contentStream.getOutputStream().write(PdfName.OC).writeSpace() .write(name).writeSpace().writeBytes(BDC).writeNewLine(); }
/** * Manually start a Marked Content sequence with properties. Used primarily for Tagged PDF * * @param tag the type of content that will be contained * @param properties the properties of the content, including Marked Content ID. If null, the PDF marker is BMC, else it is BDC * @return current canvas */ public PdfCanvas beginMarkedContent(PdfName tag, PdfDictionary properties) { mcDepth++; PdfOutputStream out = contentStream.getOutputStream().write(tag).writeSpace(); if (properties == null) { out.writeBytes(BMC); } else if (properties.getIndirectReference() == null) { out.write(properties).writeSpace().writeBytes(BDC); } else { out.write(resources.addProperties(properties)).writeSpace().writeBytes(BDC); } return this; }