You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ke...@apache.org on 2003/01/14 20:55:20 UTC

cvs commit: xml-fop/src/org/apache/fop/pdf PDFRoot.java PDFOutline.java

keiron      2003/01/14 11:55:20

  Modified:    src/org/apache/fop/pdf PDFRoot.java PDFOutline.java
  Log:
  setting for page mode, fixed some errors
  
  Revision  Changes    Path
  1.13      +45 -9     xml-fop/src/org/apache/fop/pdf/PDFRoot.java
  
  Index: PDFRoot.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/pdf/PDFRoot.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PDFRoot.java	11 Jan 2003 19:38:52 -0000	1.12
  +++ PDFRoot.java	14 Jan 2003 19:55:20 -0000	1.13
  @@ -13,6 +13,26 @@
   public class PDFRoot extends PDFObject {
   
       /**
  +     * Use no page mode setting, default
  +     */
  +    public static final int PAGEMODE_USENONE = 0;
  +
  +    /**
  +     * Use outlines page mode to show bookmarks
  +     */
  +    public static final int PAGEMODE_USEOUTLINES = 1;
  +
  +    /**
  +     * Use thumbs page mode to show thumbnail images
  +     */
  +    public static final int PAGEMODE_USETHUMBS = 2;
  +
  +    /**
  +     * Full screen page mode
  +     */
  +    public static final int PAGEMODE_FULLSCREEN = 3;
  +
  +    /**
        * the /Pages object that is root of the Pages hierarchy
        */
       protected PDFPages rootPages;
  @@ -22,6 +42,8 @@
        */
       private PDFOutline outline;
   
  +    private int pageMode = PAGEMODE_USENONE;
  +
       /**
        * create a Root (/Catalog) object. NOTE: The PDFRoot
        * object must be created before the PDF document is
  @@ -38,13 +60,13 @@
       }
   
       /**
  -     * Before the root is written to the document stream,
  -     * make sure it's object number is set. Package-private access
  -     * only; outsiders should not be fiddling with this stuff.
  -     */
  -    /*void setNumber(int number) {
  -        this.number = number;
  -    }*/
  +     * Set the page mode for the PDF document.
  +     *
  +     * @param mode the page mode
  +     */
  +    public void setPageMode(int mode) {
  +        pageMode = mode;
  +    }
   
       /**
        * add a /Page object to the root /Pages object
  @@ -95,8 +117,22 @@
           if (outline != null) {
               p.append(" /Outlines " + outline.referencePDF() + "\n");
               p.append(" /PageMode /UseOutlines\n");
  +        } else {
  +            switch (pageMode) {
  +                case PAGEMODE_USEOUTLINES:
  +                    p.append(" /PageMode /UseOutlines\n");
  +                break;
  +                case PAGEMODE_USETHUMBS:
  +                    p.append(" /PageMode /UseThumbs\n");
  +                break;
  +                case PAGEMODE_FULLSCREEN:
  +                    p.append(" /PageMode /FullScreen\n");
  +                break;
  +                case PAGEMODE_USENONE:
  +                default:
  +                break;
  +            }
           }
  -        p.append(" /PageMode /FullScreen\n");
           p.append(" >>\nendobj\n");
           return p.toString().getBytes();
       }
  
  
  
  1.6       +3 -3      xml-fop/src/org/apache/fop/pdf/PDFOutline.java
  
  Index: PDFOutline.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/pdf/PDFOutline.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PDFOutline.java	11 Jan 2003 19:38:52 -0000	1.5
  +++ PDFOutline.java	14 Jan 2003 19:55:20 -0000	1.6
  @@ -52,7 +52,7 @@
        * @param title the title of the outline entry (can only be null for root Outlines obj)
        * @param action the action for this outline
        */
  -    public PDFOutline(int number, String title, String action) {
  +    public PDFOutline(int number, String ti, String action) {
           super(number);
           subentries = new ArrayList();
           count = 0;
  @@ -61,7 +61,7 @@
           next = null;
           first = null;
           last = null;
  -        title = title;
  +        title = ti;
           actionRef = action;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org