Package org.pdfclown.documents

Examples of org.pdfclown.documents.Document


    File file = null;
    try
    {
      // Instantiate a new PDF document!
      file = new File();
      Document document = file.getDocument();

      buildPdf_page(
        document,
        imageFileFormField,
        comment
View Full Code Here


    try
    {file = new File(filePath);}
    catch(Exception e)
    {throw new RuntimeException(filePath + " file access error.",e);}

    Document document = file.getDocument();

    // 2. Named objects extraction.
    Names names = document.getNames();
    if(names == null)
    {System.out.println("No names dictionary.");}
    else
    {
      System.out.println("Names dictionary found (" + names.getContainer().getReference() + ")");
View Full Code Here

  public boolean run(
    )
  {
    // 1. Instantiate a new PDF file!
    File file = new File();
    Document document = file.getDocument();

    // 2. Insert the contents into the document!
    populate(document);

    // (boilerplate metadata insertion -- ignore it)
View Full Code Here

  public boolean run(
    )
  {
    // 1. PDF file instantiation.
    File file = new File();
    Document document = file.getDocument();

    // 2. Content creation.
    populate(document);

    // (boilerplate metadata insertion -- ignore it)
View Full Code Here

      try
      {file = new File(filePath);}
      catch(Exception e)
      {throw new RuntimeException(filePath + " file access error.",e);}
    }
    Document document = file.getDocument();

    // 2. Applying actions...
    // 2.1. Local go-to.
    {
      DocumentActions documentActions = document.getActions();
      if(documentActions == null)
      {
        document.setActions(documentActions = new DocumentActions(document));
        document.update();
      }
      /*
        NOTE: This statement instructs the PDF viewer to go to page 2 on document opening.
      */
      documentActions.setOnOpen(
        new GoToLocal(
          document,
          new LocalDestination(
            document.getPages().get(1), // Page 2 (zero-based index).
            Destination.ModeEnum.Fit,
            null
            )
          )
        );
      documentActions.update();
    }
   
    // 2.2. Remote go-to.
    {
      Page page = document.getPages().get(1); // Page 2 (zero-based index).
      PageActions pageActions = page.getActions();
      if(pageActions == null)
      {
        page.setActions(pageActions = new PageActions(document));
        page.update();
View Full Code Here

  public boolean run(
    )
  {
    // 1. PDF file instantiation.
    File file = new File();
    Document document = file.getDocument();

    // 2. Content creation.
    build(document);

    // (boilerplate metadata insertion -- ignore it)
View Full Code Here

  private void apply(
    CheckBox field
    )
  {
    Document document = field.getDocument();
    for(Widget widget : field.getWidgets())
    {
      {
        PdfDictionary widgetDataObject = widget.getBaseDataObject();
        widgetDataObject.put(
View Full Code Here

  private void apply(
    RadioButton field
    )
  {
    Document document = field.getDocument();
    for(Widget widget : field.getWidgets())
    {
      {
        PdfDictionary widgetDataObject = widget.getBaseDataObject();
        widgetDataObject.put(
View Full Code Here

  private void apply(
    PushButton field
    )
  {
    Document document = field.getDocument();
    Widget widget = field.getWidgets().get(0);

    Appearance appearance = widget.getAppearance();
    if(appearance == null)
    {widget.setAppearance(appearance = new Appearance(document));}
View Full Code Here

  private void apply(
    TextField field
    )
  {
    Document document = field.getDocument();
    Widget widget = field.getWidgets().get(0);

    Appearance appearance = widget.getAppearance();
    if(appearance == null)
    {widget.setAppearance(appearance = new Appearance(document));}
View Full Code Here

TOP

Related Classes of org.pdfclown.documents.Document

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.