Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8561519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:31:06+00:00 2026-06-11T16:31:06+00:00

I am trying to open a standard PDF form from a legacy application in

  • 0

I am trying to open a standard PDF form from a legacy application in Android, overlay form fields using iText and pass to Adobe Reader on Android to fill out the form.

I have been able to create the TextFields manually but I would prefer to have a pdf file as a template to speed up the process and better control quality.

Here is the code I have so far, this follows the itext examples.

    AssetFileDescriptor descriptor = getAssets().openFd("standardWO_Template_v1_fo.pdf");
            File templateFile = new File(descriptor.getFileDescriptor().toString());
            PdfReader reader = new PdfReader(intent.getData().getPath());
            reader.selectPages("1");
            PdfReader templateReader = new PdfReader(templateFile.getAbsolutePath());
            PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(file));
            // Stamp the template onto the document
            PdfImportedPage page = stamper.getImportedPage(templateReader, 1);
            PdfContentByte cb = stamper.getOverContent(1);
            cb.addTemplate(page, 0, 0);

The issue I am having is on the last line. cb.addTemplate(page, 0,0);

Eclipse reports the following error. The type java.awt.geom.AffineTransform cannot be resolved. It is indirectly referenced from required .class files

From what I have been able to tell java.awt.geom.AffineTransform will not work in Android only Java.

Is there a different way to accomplish my task or get AffineTransform to work in Android?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:31:07+00:00Added an answer on June 11, 2026 at 4:31 pm

    After some more searching I found this method. First I had to change from using the iText5.3.1 library in my android project to the droidText library.

    Once I installed the droidText library was able to use the following code. (and a ctrl-o in eclipse)

        File templateFile = new File(dir.getAbsolutePath() + "/templates/standardWO.pdf");
                // Read the incoming file
                PdfReader reader = new PdfReader(intent.getData().getPath());
                // Read the template form information
                PdfReader templateReader = new PdfReader(templateFile.getAbsolutePath());
                // Create the stamper from the incoming file.
                PdfStamper stamper = new PdfStamper(templateReader, new FileOutputStream(file));
                // Import the template information
                PdfImportedPage iPage = stamper.getImportedPage(reader, 1);
                // get the direct content
                PdfContentByte cb = stamper.getUnderContent(1);
                // Add the imported page to the content
                cb.addTemplate(iPage, 0, 0);
                stamper.close();
                Log.v(TAG, "Opening file in adobe reader: " + file.getAbsolutePath());
                loadDocInReader(file);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying open a new window using url.Action. And the new Window url
I´m trying to open a tab using jquery, here is my code: $(#ecContenedorFolders).tabs({ tabTemplate:
I'm trying to open a zip file with jython using FileInputStream and ZipInputStream. But
I'm trying to open a JSON file from the assets folder with an InputStream
I'm trying to open a file and read from the last point read. My
I'm trying to open a file in Openoffice from terminal and to automatically replace
I'm trying to open cmd.exe on a new process and pass some code to
I'm trying the following: I want to open an existing PDF Document and check
I am trying to connect to DB using the standard JDBC way connection =
I'm trying to open a series of Excel spreadsheets using an instance of Excel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.