Lines 151-169
class PDFLogicalStructureHandler {
Link Here
|
151 |
private void processNode(StructureElement node, PDFStructElem parent, boolean isStatic) { |
151 |
private void processNode(StructureElement node, PDFStructElem parent, boolean isStatic) { |
152 |
String ptr = node.getPtr(); |
152 |
String ptr = node.getPtr(); |
153 |
assert ptr != null; |
153 |
assert ptr != null; |
154 |
PDFStructElem structElem = pdfDoc.getFactory().makeStructureElement( |
154 |
PDFStructElem structElem; |
|
|
155 |
String role = node.getRole(); |
156 |
|
157 |
if ("hidden".equals(role)) |
158 |
return; |
159 |
if (!"inherit".equals(role)) { |
160 |
structElem = pdfDoc.getFactory().makeStructureElement( |
155 |
FOToPDFRoleMap.mapFormattingObject(node, parent, eventBroadcaster), parent); |
161 |
FOToPDFRoleMap.mapFormattingObject(node, parent, eventBroadcaster), parent); |
156 |
|
162 |
|
157 |
String nodeName = node.getName(); |
163 |
String nodeName = node.getName(); |
158 |
if (nodeName.equals("external-graphic") || nodeName.equals("instream-foreign-object")) { |
164 |
if (nodeName.equals("external-graphic") || nodeName.equals("instream-foreign-object")) { |
159 |
String altTextNode = node.getAltText(); |
165 |
String altTextNode = node.getAltText(); |
160 |
if (altTextNode != null) { |
166 |
if (altTextNode != null) { |
161 |
structElem.put("Alt", altTextNode); |
167 |
structElem.put("Alt", altTextNode); |
162 |
} else { |
168 |
} else { |
163 |
structElem.put("Alt", "No alternate text specified"); |
169 |
structElem.put("Alt", "No alternate text specified"); |
|
|
170 |
} |
164 |
} |
171 |
} |
165 |
} |
172 |
} |
166 |
|
173 |
else |
|
|
174 |
structElem = parent; |
175 |
|
167 |
if (isStatic) |
176 |
if (isStatic) |
168 |
structStaticTreeMap.put(ptr, structElem); |
177 |
structStaticTreeMap.put(ptr, structElem); |
169 |
else |
178 |
else |
170 |
- |
|
|