Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Open PDF

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Open PDF

    Hi, Could someone give me the code to open a PDF document, I am guessing its starts with somthing like the below. Thanks in advance.

    resp.setContentType("application/pdf");


  2. #2
    Member
    Join Date
    Feb 2012
    Posts
    58
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Re: Open PDF

    You may need to set header:

    resp.setHeader("Content-disposition", "attachment; filename=YourFile.pdf" );

Similar Threads

  1. Open file from JAR
    By StevenTNorris in forum AWT / Java Swing
    Replies: 2
    Last Post: October 29th, 2011, 12:02 PM
  2. AWT Desktop Open
    By StevenTNorris in forum What's Wrong With My Code?
    Replies: 11
    Last Post: October 24th, 2011, 02:34 PM
  3. Open web page according to day
    By caenleve in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 8th, 2011, 07:22 PM
  4. How do i have a jButton Open a URL?
    By dragon40226 in forum Java Theory & Questions
    Replies: 2
    Last Post: March 7th, 2011, 04:21 AM
  5. how to open a jsp in a new jsp
    By ajincoep in forum JavaServer Pages: JSP & JSTL
    Replies: 1
    Last Post: February 7th, 2011, 05:45 AM