Friday, March 3, 2006

How to install a printer from a DWF

I have though about sharing this tip about "Printer Connector" a long time. I've got some emails from those wondering how it could be done after Shaan Hurley, Autodesk posted about a solution I made a few years ago at the company I work for. Now I got reminded again reading about Internal Facilities Management application by Scott Sheppard, Autodesk. I assisted Brian Mathews and Brian Pene at their class at Autodesk University 2005 in Florida and I really recommend you to take a look at the available class materials you can find on Scott's blog. Actually Brian was one of those wondering how I had solved installing the printers from a DWF hyperlink. Nice to see that it's used at Autodesk too. Now to the solution that is really simple but useful.

Start with a DWG drawing of the facility and add a block that represents a printer or plotter. Add a hyperlink on the block that links to a html file on a location available for all users. Use the name of the printer and maybe size and type as description. The content of the html file is here. Just change the server name and the printer name in the code. Now Plot or Publish the drawing to DWF. If you have several levels and buildings you can create a main html page that links to these DWF files. The DWF files can also be embedded into a html page and add some simple instructions that they should click on a printer etc.
<html>
<head>
</head>
<p><font face="Verdana">Printer connection...</font></p>
<SCRIPT LANGUAGE="VBScript">
<!--
on error resume next
Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\SERVERNAME\PRINTERNAME"
msg="Do you want " & PrinterPath & " to be Default printer?"
answ=msgbox(msg,vbYesNoCancel,"Add Printer")
If answ=vbYes then
  WshNetwork.AddWindowsPrinterConnection PrinterPath
  WshNetwork.SetDefaultPrinter PrinterPath
elseif answ=vbNo then
  WshNetwork.AddWindowsPrinterConnection PrinterPath
end if
history.back()
-->
</SCRIPT>
</html>
See this html code or check in the DWF Viewer Help.
<script language="vbscript">
<!--
on error resume next
if not IsObject(CreateObject("AdView.AdViewer")) then msgbox "You need the DWF Viewer!" & vbNewLine & vbNewLine & "Please contact the IT department."
function ShowPrinters
EView.Viewer.HighlightLinks = not EView.Viewer.HighlightLinks
end function
-->
</script>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Printer Connector</title>
<style type="text/css">
a:link {color: #FFFFFF}
a:visited {color: #FFFFFF}
a:hover {color: #FF0000}
a:active {color: #FFFFFF}
</style>
</head>

<body bgcolor="#4083A8" topmargin="0">

<OBJECT
id=Eview
codeBase="file:///server/dwfviewer/installer/DwfViewerSetup.cab"
classid=clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF
width=100%
height=92% border="2" vspace="4">
<param name="_cx" value="38788">
<param name="_cy" value="25056">
<param name="BackColor" value="7895160">
<param name="EmbedDoc" value="0">
<param name="Src" value="Printers.dwf?NotifyMissingFonts = false">
<param name="ViewerParams" value="?NotifyMissingFonts = false">
</OBJECT>

<script language="vbscript">
<!--
; If multipage DWF's are used navigate to the page named "Level 8"
EView.Viewer.Page = "Level 8"
-->
</script>

<font face="Verdana" color="#FFFFFF" size="2">
<i>Click on the
<a title="Flash the printers" href="vbscript:ShowPrinters">printer</a> you want to have installed.
</i></font><br>
<font face="Verdana" size="1"><font color="#FFFFFF">Send mail to
<a href="mailto:HelpDesk%20IT?subject=Printer Connector">HelpDesk IT</a> or
the </font>
<a href="mailto:info@jtbworld.com?subject=Printer Connector">
Author</a><font color="#FFFFFF">
with questions or comments about Printer Connector.</font></font>
</body>

</html>

I recommend that you activate usage of single click to follow hyperlinks or include instructions to hold down CTRL + Click.

I hope you get the idea. Feel free to use it, have fun and impress on your management and users and IT. Feel free to contact me if you got any questions or post a comment.


Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner