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 6474229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:33:46+00:00 2026-05-25T06:33:46+00:00

I am currently getting a page from a PDF and then trying to edit

  • 0

I am currently getting a page from a PDF and then trying to edit that particular page.
When i do the edit it is not saving within the PDF itself.

This is my code could someone please help.

PDPage page = (PDPage) allPages.get(f);
System.out.println(page);
PDRectangle pageSize = page.findMediaBox();
float stringWidth = font.getStringWidth( "AAA" );
float centeredPosition = (pageSize.getWidth() - (stringWidth*fontSize)/1000f)/2f;

PDPageContentStream contentStream = new PDPageContentStream(pdoc,page,true,false);

contentStream.beginText();
contentStream.setFont( font, fontSize );
//contentStream.addLine(700, 700, 700, 1000);
contentStream.moveTextPositionByAmount(0 , 0);
contentStream.drawString( "AAA" );
contentStream.endText();
contentStream.close();

pdoc.save("C:/1/1.pdf");
pdoc.close();
  • 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-05-25T06:33:47+00:00Added an answer on May 25, 2026 at 6:33 am

    The code is with which I am doing this is correct.

    The problem is not the code but the way the pdfs are being generated are at a Version 1.2.
    I would need to be able know what I can do to alter PDFs that are one V 1.2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to pull the wall from this event page: https://www.facebook.com/event.php?eid=139373546157232 , but
Currently getting this following error: You do not have permission to view this directory
I'm trying to extract some textual data from a PDF file. To do this,
I'm currently trying to invoke a web service from a web application that I've
I am currently getting first day Of this week and last week values with
I am currently getting images from the 'Documents' directory (using -imageWithContentsOfFile:) with no problems
I'm currently getting a Could not load type UI.Administration.Site.master error message and I'm not
I'm currently getting all the Select elements that exist in a form with the
I'm using prepared statements and MySQLi, and am currently getting this error. PHP Catchable
I am currently working through this tutorial: Getting Started with jQuery For the two

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.