• Post Reply Bookmark Topic Watch Topic
  • New Topic

File Not Found Error  RSS feed

 
Steve Dyke
Ranch Hand
Posts: 1783
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the console output:

SilentPDFPrinter: dwgpath: http://simplyw/drawings/857000/857235A.pdf
SilentPDFPrinter: ffne: java.io.FileNotFoundException: http:\simplyw\drawings\857000\857235A.pdf (The filename, directory name, or volume label syntax is incorrect.)


I can view the file by copying the path into browser so I know it exists.

This is my java code:


 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"http://simplyw/drawings/857000/857235A.pdf" is not a file name, it's an URL - so a FileInputStream can't handle it. You can get an InputStream -which you can substitute for a FileInputStream in many cases- to read from an URL like new URL("http://simplyw/drawings/857000/857235A.pdf").openStream().
 
Steve Dyke
Ranch Hand
Posts: 1783
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:"http://simplyw/drawings/857000/857235A.pdf" is not a file name, it's an URL - so a FileInputStream can't handle it. You can get an InputStream -which you can substitute for a FileInputStream in many cases- to read from an URL like new URL("http://simplyw/drawings/857000/857235A.pdf").openStream().


Changed as suggested and got it to print but all that printed out was url path on the page.

Here is what I am using to try and print out pdf files without user interaction.

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the printer capable of printing PDFs on its own? Not all printers can, or not without using special drivers or software that interprets PDFs.
 
Steve Dyke
Ranch Hand
Posts: 1783
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Is the printer capable of printing PDFs on its own? Not all printers can, or not without using special drivers or software that interprets PDFs.


How can I tell?
 
Steve Dyke
Ranch Hand
Posts: 1783
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Is the printer capable of printing PDFs on its own? Not all printers can, or not without using special drivers or software that interprets PDFs.


What would you suggest to print PDF file silently from a web application?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I tell?

The printer's documentation should talk about that.

What would you suggest to print PDF file silently from a web application?

Maybe a dedicated PDF library can help: http://pdfbox.apache.org/commandline/#printPDF
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!