From: Jeremias Maerki Date: Mon, 8 May 2006 21:13:21 +0000 (+0000) Subject: Adding missing mandatory flags for PDF/A-1. X-Git-Tag: fop-0_93~235 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e98e4a82127082d77e073e8d72f17231d5e5b9c1;p=xmlgraphics-fop.git Adding missing mandatory flags for PDF/A-1. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@405167 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/pdf/PDFLink.java b/src/java/org/apache/fop/pdf/PDFLink.java index 30929d29e..e0cd2a661 100644 --- a/src/java/org/apache/fop/pdf/PDFLink.java +++ b/src/java/org/apache/fop/pdf/PDFLink.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2004,2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,12 +71,21 @@ public class PDFLink extends PDFObject { * @see org.apache.fop.pdf.PDFObject#toPDFString() */ public String toPDFString() { + String fFlag = ""; + if (getDocumentSafely().getPDFAMode().isPDFA1LevelB()) { + int f = 0; + f |= 1 << (3 - 1); //Print, bit 3 + f |= 1 << (4 - 1); //NoZoom, bit 4 + f |= 1 << (5 - 1); //NoRotate, bit 5 + fFlag = "/F " + f; + } String s = getObjectID() + "<< /Type /Annot\n" + "/Subtype /Link\n" + "/Rect [ " + (ulx) + " " + (uly) + " " + (brx) + " " + (bry) + " ]\n" + "/C [ " + this.color + " ]\n" + "/Border [ 0 0 0 ]\n" + "/A " - + this.action.getAction() + "\n" + "/H /I\n>>\nendobj\n"; + + this.action.getAction() + "\n" + "/H /I\n" + + fFlag + "\n>>\nendobj\n"; return s; }