1

I have seen questions similar to this but different enough that I felt I needed to post a new one.

It seems that there is a lot of information on creating a link that will print the browser page, but I need to create an anchor tag that will print a specific file linked in that anchor tag and I'm not sure how to go about this.

A literal example of what's needed:

<a href="somepdf.pdf">Print the PDF</a>

The idea is that the user then clicks this link and the print action is automatically implemented.

Any thoughts on how this might be done?

Apologies in advance if this has been answered and I just couldn't find it.

tganyan
  • 603
  • 3
  • 9
  • 23
  • Take a look at this link I found: http://stackoverflow.com/questions/12276416/how-to-open-a-link-new-tab-with-print-command – Zich Aug 10 '16 at 21:13

2 Answers2

-1

You can do this

<a href="http://www.pdfprint.it//printPdf?auth=XXXX&pdfUrl=http://www.pdfprint.it/example.pdf" >Print me!</a>

Here is more detailed documentation about this service. http://www.pdfprint.it/doc

EDIT:

You can also make users print it from another winodw. Just open new window with your pdf with using tag and then make it open print options with window.print() automatically.

uRTLy
  • 129
  • 1
  • 6
-1

I think you want to print pdf file on clicking the specific words written between the anchor tag. If this is than you have did everything right if the pdf file would be on the index.html location than it will get open automatically. Otherwise you have to set a different location on the anchor tag to specify the same PDF file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Sample</title> </head>

<body> <a href="drill.pdf"> Drill PDF </a> </body> </html>

Give name drill.pdf to any PDF file and save it in the same location you will save this HTML. It should be working.