Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying pdf file in browser  RSS feed

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am trying to convert HTML to pdf format. The following code works fine but despite writing file to "c://temp//testpdf.pdf" I want to display output as pdf file in browser



Please advise

Thanks in anticipation
 
Carey Brown
Bartender
Posts: 2994
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you meant to use backslashes instead of forward slashes.
 
Paul Clapham
Sheriff
Posts: 22487
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't enough context to answer.

If the code you posted is in a servlet, for example, you would just change it to write to the servlet's output stream instead of to that file.

Or if you wanted to have Adobe Reader (not the browser) start up and display that file after you wrote it, then you would use the java.awt.Desktop class to do that.

If neither of those guesses is right, then provide more information about your question.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carey Brown wrote:I think you meant to use backslashes instead of forward slashes.

Needless. On Windows either will work.
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletOutputStream fixed the issue

Thanks all from the bottom of my heart

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!