List of usage examples for com.lowagie.text.pdf PdfName SPAN
PdfName SPAN
To view the source code for com.lowagie.text.pdf PdfName SPAN.
Click Source Link
From source file:net.sf.jasperreports.engine.export.JRPdfExporterTagHelper.java
License:Open Source License
/** * *//*from w w w . ja va 2 s . c o m*/ protected void init(PdfContentByte pdfContentByte) { this.pdfContentByte = pdfContentByte; if (isTagged) { PdfStructureTreeRoot root = pdfWriter.getStructureTreeRoot(); allTag = new PdfStructureElement(root, new PdfName("All")); root.mapRole(new PdfName("All"), new PdfName("Sect")); if (pdfWriter.getPDFXConformance() == PdfWriter.PDFA1A) { root.mapRole(new PdfName("Anchor"), PdfName.NONSTRUCT); root.mapRole(PdfName.TEXT, PdfName.SPAN); root.mapRole(PdfName.IMAGE, PdfName.FIGURE); } else { root.mapRole(new PdfName("Anchor"), PdfName.TEXT); } if (language != null) { allTag.put(PdfName.LANG, new PdfString(language)); } tagStack = new Stack<PdfStructureElement>(); tagStack.push(allTag); } }
From source file:net.sf.jasperreports.engine.export.JRPdfExporterTagHelper.java
License:Open Source License
protected void createEndTags(JRPrintElement element)// throws DocumentException, IOException, JRException { if (element.hasProperties()) { String prop = element.getPropertiesMap().getProperty(PROPERTY_TAG_TABLE); if (prop != null && (TAG_END.equals(prop) || TAG_FULL.equals(prop))) { pdfContentByte.endMarkedContentSequence(); tagStack.pop();//from www.ja va 2 s.c o m } prop = element.getPropertiesMap().getProperty(PROPERTY_TAG_TR); if (prop != null && (TAG_END.equals(prop) || TAG_FULL.equals(prop))) { pdfContentByte.endMarkedContentSequence(); tagStack.pop(); } prop = element.getPropertiesMap().getProperty(PROPERTY_TAG_TH); if (prop != null && (TAG_END.equals(prop) || TAG_FULL.equals(prop))) { pdfContentByte.endMarkedContentSequence(); if (isTagEmpty) { pdfContentByte .beginMarkedContentSequence(new PdfStructureElement(tagStack.peek(), PdfName.SPAN)); pdfContentByte.endMarkedContentSequence(); } tagStack.pop(); } prop = element.getPropertiesMap().getProperty(PROPERTY_TAG_TD); if (prop != null && (TAG_END.equals(prop) || TAG_FULL.equals(prop))) { pdfContentByte.endMarkedContentSequence(); if (isTagEmpty) { pdfContentByte .beginMarkedContentSequence(new PdfStructureElement(tagStack.peek(), PdfName.SPAN)); pdfContentByte.endMarkedContentSequence(); } tagStack.pop(); } prop = element.getPropertiesMap().getProperty(JRCellContents.PROPERTY_TYPE); if (prop != null && (JRCellContents.TYPE_CROSSTAB_HEADER.equals(prop) || JRCellContents.TYPE_COLUMN_HEADER.equals(prop) || JRCellContents.TYPE_ROW_HEADER.equals(prop) || JRCellContents.TYPE_DATA.equals(prop))) { pdfContentByte.endMarkedContentSequence(); if (isTagEmpty) { pdfContentByte .beginMarkedContentSequence(new PdfStructureElement(tagStack.peek(), PdfName.SPAN)); pdfContentByte.endMarkedContentSequence(); } tagStack.pop(); } prop = element.getPropertiesMap().getProperty(PROPERTY_TAG_H1); if (prop != null && (TAG_END.equals(prop) || TAG_FULL.equals(prop))) { pdfContentByte.endMarkedContentSequence(); if (isTagEmpty) { pdfContentByte .beginMarkedContentSequence(new PdfStructureElement(tagStack.peek(), PdfName.SPAN)); pdfContentByte.endMarkedContentSequence(); } tagStack.pop(); } prop = element.getPropertiesMap().getProperty(PROPERTY_TAG_H2); if (prop != null && (TAG_END.equals(prop) || TAG_FULL.equals(prop))) { pdfContentByte.endMarkedContentSequence(); if (isTagEmpty) { pdfContentByte .beginMarkedContentSequence(new PdfStructureElement(tagStack.peek(), PdfName.SPAN)); pdfContentByte.endMarkedContentSequence(); } tagStack.pop(); } prop = element.getPropertiesMap().getProperty(PROPERTY_TAG_H3); if (prop != null && (TAG_END.equals(prop) || TAG_FULL.equals(prop))) { pdfContentByte.endMarkedContentSequence(); if (isTagEmpty) { pdfContentByte .beginMarkedContentSequence(new PdfStructureElement(tagStack.peek(), PdfName.SPAN)); pdfContentByte.endMarkedContentSequence(); } tagStack.pop(); } } }
From source file:net.sf.jasperreports.engine.export.PdfGlyphRenderer.java
License:Open Source License
@Override public void draw() { if (addActualText) { PdfDictionary markedContentProps = new PdfDictionary(); markedContentProps.put(PdfName.ACTUALTEXT, new PdfString(allText, PdfObject.TEXT_UNICODE)); pdfContentByte.beginMarkedContentSequence(PdfName.SPAN, markedContentProps, true); }//from w w w .ja v a 2 s.com TabSegment segment = segments.get(segmentIndex); segment.layout.draw(pdfGraphics2D, x + drawPosX, // + leftPadding, y + topPadding + verticalAlignOffset + drawPosY); if (addActualText) { pdfContentByte.endMarkedContentSequence(); } return; }