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

  • Home
  • SEARCH
  • 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 8675801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:02:03+00:00 2026-06-12T20:02:03+00:00

I am using the http://sourceforge.net/projects/jlibeps/ library. I have an existing Graphics2D object that is

  • 0

I am using the http://sourceforge.net/projects/jlibeps/ library.

I have an existing Graphics2D object that is already drawn onto, and then want to create a new EpsGraphics2D object from the Graphics2D object.

Is this possible, or any suggestions on how to accomplish this?

The jlibeps author provided this example, but I fail to understand how the paint(g) line can accomplish this:

//If you want to paint a Graphics2D in an EPS file, you can do that:
FileOutputStream finalImage = new FileOutputStream(file);
EpsGraphics2D g = new EpsGraphics2D("Title", finalImage, 0, 0, 500, 500);
paint(g);
g.flush();
g.close();
finalImage.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-06-12T20:02:05+00:00Added an answer on June 12, 2026 at 8:02 pm

    Having a Graphics2D object in general won’t help you, as it allows you to draw to some medium, but not to read what is currently rendered to that medium, much less what instructions were used to draw the current content.

    Instead, you have to feed a EpsGraphics2D object into the pipeline just the same way you would a Graphics2D object for screen rendering. Usually you want to draw the content of some component. That can be done by calling its paint method. So by calling that paint method with your constructed eps graphics object, you can cause all painting instructions to go to the eps file. That is what the paint(g) line in the manual refers to.

    To phrase this differently: you do not need an existing Graphics2D object which you magically turn into an EpsGraphics2D object. Instead, you need a chain of method calls which does something useful to a Graphics2D object, i.e. renders some content to it. Then you can re-use that code to generate an eps file by passing a EpsGraphics2D object (which is simply a special case of a Graphics2D object, and hence of a Graphics object) to the outermost invocation of that code.

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

Sidebar

Related Questions

I have been trying to create an XML using the simplexml library (v2.6.2) http://simple.sourceforge.net/home.php
I have integrated the facebook in my app using http://sourceforge.net/projects/facebook-bb-sdk , it work fine
I am using TurboPower LockBox 3 ( http://sourceforge.net/projects/tplockbox/ and http://lockbox.seanbdurkin.id.au/tiki-index.php ) I have a
I'm using http://sourceforge.net/projects/dockpanelsuite/ as a docking control in my application and I have added
I have been using extplorer http://extplorer.sourceforge.net/ Are there any good alternatives which run on
I have a requirement to create Chart like this : http://sourceforge.net/projects/ecgtoolkit-cs/ I have to
I am using phpexcelreader: http://sourceforge.net/projects/phpexcelreader/ And It is working nicely compared to all the
I have downloaded the 3.4 version from here http://sourceforge.net/projects/pdcurses/files/pdcurses/ . I copied the pdcurses.dll
I am using an example program from this code http://sicktoolbox.sourceforge.net/ > http://sourceforge.net/projects/sicktoolbox/files/ . It's
I'm using the latest version of iTextSharp found here: http://sourceforge.net/projects/itextsharp/ I am trying to

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.