]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Adding missing mandatory flags for PDF/A-1.
authorJeremias Maerki <jeremias@apache.org>
Mon, 8 May 2006 21:13:21 +0000 (21:13 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 8 May 2006 21:13:21 +0000 (21:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@405167 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/pdf/PDFLink.java

index 30929d29e63834a213928a92ae4d67a2feb7bc0c..e0cd2a6617376758cab26956e164900e4329a1d2 100644 (file)
@@ -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;
     }