Print a JFrame in a PDF file ?

hello,
I just downloaded the iText library which allows the generation of pdf files. i'm just wondering if there is a way to print a JFrame into a pdf File, in other words I want that the Jframe which holds all my components to be printed in a pdf file.
anyone has any clue? is it possible at least ?
thank you!

I think it was something like this:
Document document = new Document(pageSize);
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(outFile));
document.open();
PdfContentByte cb = writer.getDirectContent();
Graphics2D g2 = cb.createGraphics(pageSize.getWidth(), pageSize.getHeight());You can then pass the Graphics2D instance to the frame's paint(Graphics) or print(Graphics) method - you will, of course, have to set the correct size for frame first.

Similar Messages

  • I Need to print a portion of a pdf file using a dos command. Can i ?

    Hello,
    I Need to print a portion of each page of a pdf file using a dos command without opening it.
    Can i do it ? if yes how ?
    Thanks in Advance for your help.

    hello,
    Thanks for your reply. If i use another printing software like ghostscript
    or foxit reader will i be able to do it ?
    Regards
    Le 14 déc. 2014 18:49, "Bernd Alheit" <[email protected]> a écrit :
        I Need to print a portion of a pdf file using a dos command. Can i ?
    created by Bernd Alheit <https://forums.adobe.com/people/Bernd+Alheit> in *Printing
    & Prepress* - View the full discussion
    <https://forums.adobe.com/message/7013717#7013717>

  • Using Acrobat 9 and suddenly there is no selected page range in the print box.   Only selected PDF files or all PDF files.  Am I doing something wrong?  I need to print only three pages from the document

    There is no selected print page range in the print box.  Only selected PDF file and all PDF files.  Any suggestions?

    Well, I looked for where to delete this but didn't see it.
    NEVERMIND; I forced iPhoto to quit and restarted and everything seems fine.
    BTW, I did get one thing wrong. When I looked at both iPhoto libraries with FINDER, the active one and the archived one both showed content as far as file size goes.
    It was because I was viewing the files through Adobe Bridge that it was showing 0 GB's; for whatever reason.

  • Hp 1007 laser printer cant show only in pdf file print order que

    hp 1007 laser printer cant show only in pdf file print order que

    Hi @amoldixit, 
    Please clarify your issue and what I can do to help you.
    What operating system are you using? How to Find the Windows Edition and Version on Your Computer.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • How to Print The Entire Course as PDF file from "The Sun Learning CD-ROM"

    Is anyone able to print entire course as PDF file? I'm currently learning Solaris 10 OS and trying to print the full course/module on CDS-200-S10: Intermediate System Administration for Solaris 10 Operating System CD but unsuccessful.
    It seems like I can only print individual page from each module. I have Adobe Acrobat installed on my system. Your helps is greatly appreciated.

    Hi Ankur Ver,
    This forum is to discuss problems of Windows Forms. Your question is related to itextsharp, it is the third-party library.
    You can consider contacting the official for supports, Thanks for your understanding.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Why can't I print a map from a PDF file?

    I am going to the website   http://www.atac.roma.it/   which is the public transit system for Rome, Italy. If you scroll down and click on the green button for     Linee e Mappe     and then scroll down on the next page and click on the PDF file for the      Line e Elettriche     you will get the map for the electric buses that runs through Rome. You will notice at the top of that page on my computer it says        "doc.pdf(secured) Adobe Reader".     You will also notice that there is no option to print the map. This did not used to be the case as I have printed maps off this site before.
    I do not have any add-on for Adobe reader. I am able to print PDF files. I do it all the time. I just did it now, but when I have those pages open I do have the option to print.
    I don't have any problem viewing the page, either the website or the PDF file of the map. I just can not print it. Because it says "Secured" would the mean that  ATAC.Roma does not want everyone printing their map?
    Thank you,
          TomS

    That is because the document's security settings disallows printing (as well as everything else).

  • How to disable print and download button of pdf file when i am opening mozila firefox using java script

    i am opening pdf file in firefox browser in right side i am seeing print and download option
    i want to disable it by program like javascript, by manualy i can disable it ,
    actually i am opening pdf file in my website by using firefox browser so i do not want to any can download or print the pdf file

    If it's that critical, you could explore this partial workaround:
    Use a script or configuration file on your server that changes the disposition based on the user agent. In other words, for Firefox, send an attachment disposition that forces a download outside the browser instead of the default (inline) disposition that allows Firefox to display the PDF in a tab.
    Now... that won't stop the user from dragging and dropping the downloaded file on a Firefox tab to use the built-in PDF viewer, but most users would tend to open the file in their default viewer (e.g., stand-alone Adobe Reader).

  • Booklet converted to .pdf is fine for printing/folding, but for putting pdf file online website - pages in wrong order.  How to fix?

    I created a booklet in Publisher and then saved as .pdf file to post on a website.  When printed, pages are ok for folding and printing in the right order, but the .pdf file to look at shows pages out of order.  is there a way to fix this?

    Not with Reader.
    You would probably need to rebuild the original document and recreate the pdf.

  • Printing document with table to PDF - file disappears

    When I print a document to PDF from either AppleWorks or MS Word, it is saved to the location as PDF and works as would be expected. If the file contains a table, the PDF file initially appears where saved but disappears when I attempt to access it.
    The document was initially created in AppleWorks. The MS Word document was translated from AppleWorks.
    The PDF file quite literally disappears from the screen. All routine Mac software maintenance is on schedule and all Apple updates for my OS completed to date.

    The solution is logical, if annoying.
    My Print to PDF problem has been solved. I complained about not being able to save documents containing tables created on AppleWorks as PDF, but the tables were not the problem. The problem was a font within a table. I discovered this when I could also not print the document to a printer. Despite saving as PDF being a print routine, I cannot get out of Save As mode. The document did print to PDF on my mother’s iBook because another font was substituted in the table.
    There are several fonts on my PowerBook that will not print, even on a postscript printer that has them on board. That is a separate and largely ignored problem. One of those is the Bookman family. Too bad. I like that family and use it frequently with older operating systems, but OS X refuses to print anything containing that font. I have never taken the time to troubleshoot the problem.
    I had already performed the searches suggested to no avail. The point of all this is that font problems that prevent printing a document to a printer will also prevent a document from printing to PDF. The icon initially appearing then going away seems odd to me but probably not to a MacGeek.
    Thank you, Mask, for giving thought to this issue. Now, maybe I should invest in a font troubleshooting application.

  • Printing issues from InDesign CS4 pdf file

    Good morning,
    Could you help explain and possibly resolve an issue I'm having with an InDesign CS4 pdf file where the text and image drop shadows (40%) are printing as solid black blocked shapes from a large format printer. The file encompasses 1 overall image, 1 image with drop shadow, 3 text frames with drop shadow effect applied to the text and 1 group set of simple rectangular and ellipse objects with a glow.
    My colleagues in graduate school experienced the same with their files and the output bureau's rasterized the pdf file in Photoshop where it printed out with good resolution. Shouldn't this be resolved first in InDesign rather than rasterizing the file?
    I appreciate any help and insight you could offer myself and my colleagues.
    Thank you, Kathryn

    The printing service uses Acrobat 8 Pro and HP large format printer. My InDesign CS4 document is in the color mode of RGB and color type as Process. I saved it as a pdf file using the standard settings as follows: Preset: High Quality Print, Standard: None and Compatibility: Acrobat 4 (PDF 1.3). Are there options I should be paying more attention to when creating the PDF file? Also, I was reading up on Peter Spier's response links.
    This brings me to the next question...I'm creating a photo book for grad school with approximately 40 pages of images (RGB, 300dpi) with feathered drop shadows. What would be the best settings to use when exporting as a pdf file for printing services?
    Thank you for your help.
    Kathryn

  • Adobe PDF printer failed to create the PDF file

    Just installed Acrobat 9 Standard on new HP Touchsmart running Vista 64 bit - tried to create a pdf from a *.pub, and got the error message above, and "please correct the error and try again".  If I knew what the error was, I'd try to correct it.

    If you check the PDF file with ctrl-D and select the font tab, you will likely find that the font you mention is not embedded. The font not being embedded will make major differences in terms of what fonts Acrobat or Reader finds to do a substitution. Also, the fonts may not display correctly if you have the Use Local Fonts check box selected incorrectly (just try changing that choice).
    Fonts can be a major issue in terms of licensing for embedding and such. Also, different job.settings file selections may cause fonts to not be properly embedded.
    Since the printer works, the issue of the other packages is the need for PDF Maker to be active in those applications that you are trying to import files from. To check PDF Maker, you need to test it in those applications, not in Acrobat. Trying things in Acrobat is the last step, not the first step. In WORD, there is a need for certain settings to be properly set to allow PDF Maker to work. These may be the issues you are having. So, go back to the applications of interst and be sure that PDF Maker works from the application -- this is the create PDF button.

  • I downloaded Adobe Reader 9.3 and now I can't read or print out any of my Pdf files.  Help!

    I downloaded Adobe 9.3 and now I can't read or print
    any of my Pdf files.  Help!

    Windows 7.  I get an error Message - Runtime Error - A network error occurred while attempting to read from the file.  Routine Error - This application has requested the runtime to terminate in an unusual way.

  • How to not print a section inside a PDF file

    Hey PDF nation,
    I have full color PDF file with multiple pages on our site which has a blue background all over. The issue is if you want to print it, you'll run out of ink. On the other hand I can't change the design and make the background white. Is there anyway to tell your PDF file to print some sections differently or not to print? Am I out of luck?
    Thanks in advance.

    You're out of luck, unless you have Photoshop or Illustrator in which you can open the PDF and edit it.

  • Print selected pages of a PDF file to printer as a batch job using VB6

    I have the following:
    1) 1,000 multi-paged PDF files (say 00000001.pdf, 00000002.pdf, ..., 00160000.pdf)
    2) A list of pages for each document to print
    (e.g. 00000001.pdf: 2,3,5,7
    00000002.pdf: 3-8, 10
    00001000.pdf: 5,6,7,10)
    I want to perform a single batch job to print the specified pages of all 1000 PDF documents to default printer.
    I am using VB6, Acrobat Reader 9 installed.
    I am thinking of writing a function like that:
    Private Function PrintPDF(byval sPDFFilePath as string, byval iPageNum() as integer) as boolean
    and then write a looping routine to print the files one by one.
    Seems that Acrobat SDK has such feature. 
    Please advise how can I do this?

    I downloaded the Arcobat SDK and now learning to use it with its sample.
    However, I got stuck when I run the program BasicIacVB.
    I got the following error message:
    Cannot create ActiveX component.
    When running the line
    gApp = CreateObject("AcroExch.App")
    I run this program on my PC with VS2005 installed.
    What extra step do I need to do to use the sdk?
    Seems there's no installation package there...
    Sorry about my stupid question, I am a total newbie in AcrobatSDK.
    P.S.  My ultimate goal is to develop the program in VB6 (not using VB2005),
    as my client PCs does not (and cannot for some reason) install .net framework.

  • Printing and Sizing Problems with PDF Files

    I have grading keys saved as PDF files.  When I open them in the Adobe Reader X, some come up looking fine, fitting nicely on an 8.5" x 11" page and ready for print.  Others come up looking shrunken and in the middle of the page.  When I try to resize and print these, I get all kinds of funky results.
    What I want to do is process all the PDF files (grading keys) so that they will fit nicely on the 8.5x11, without the user having to do a bunch a stuff resizing, etc.
    I have included links to two PDF files below.  The first comes up fine in the Adobe Reader and the sond does not.  Can anyone help me with this perplexing issue?  Thanks.
    www.goodnewsjail.org/good.pdf  (Formatted correctly)
    www.goodnewsjail.org/toosmall.pdf (Comes up looking scrunched on the page)
    Note:  I might add that when I open these files in Adobe Photoshop CS, the one above that looks good comes up with dimensions 23.687"x17.745", while the one that comes up looking funky has dimensions 10.24"x7.85".  I am as confused as a termite in a yo-yo.

    Both of your documents have the same size: 279.4mm x 215.9mm.  The difference is that the 'good.pdf' has its content evenly distributed over the available size, the other one has its content minimized in the center, with a large white space around it (in Adobe Acrobat).
    As for why it shows a different size in Photoshop, I have no idea.
    There is not much you can do about it with Adobe Reader, but you can change the size using Photoshop or Illustrator.  See attachment to this post.

Maybe you are looking for

  • Background Image on a Component

    How do I add a background image to a component, in this case, a scrollpane containing a drawing area. This is for a level editor for my game. I want a level's background image to be drawn and tiled so the user can get a better preview of what the lev

  • Relaying temporarily denied

    org.apache.jasper.JasperException: Sending failed; nested exception is:      class javax.mail.SendFailedException: Invalid Addresses; nested exception is:      class javax.mail.SendFailedException: 450 4.7.1 ... Relaying temporarily denied. Cannot re

  • IDVD will not burn iMovie

    I prepared an iMovie, "shared" into iDVD, and waited the roughly 3 1/2 hours while processing occurred. The burn cycle never started. I got a message indicating something like "multiplex errors". I also tried to burn using Disk Utility - also unsucce

  • Geotagging and photoshop elements 9

    I used to work with photoshop elements 5 (english edition) since 5 years and i happily geotagged all my image database ( >20k images). Now i upgraded to PE 9 (italian edition) and geotagging seems to be disappeared. It is true or can't find it ? And

  • HT5312 can you help me with my security questions?

    can u help me with my security questions