&& pageViewport.getExtensionAttachments().size() > 0) {
Iterator it = pageViewport.getExtensionAttachments().iterator();
while (it.hasNext()) {
ExtensionAttachment attachment = (ExtensionAttachment) it.next();
if (AFPExtensionAttachment.CATEGORY.equals(attachment.getCategory())) {
AFPExtensionAttachment aea = (AFPExtensionAttachment)attachment;
if (AFPElementMapping.INVOKE_MEDIUM_MAP.equals(aea.getElementName())) {
AFPInvokeMediumMap imm = (AFPInvokeMediumMap)attachment;
String mediumMap = imm.getName();
if (mediumMap != null) {
if (!mediumMap.equals(lastMediumMap)) {
dataStream.createInvokeMediumMap(mediumMap);