Solved

vbscript Creating pdf printer port

Posted on 2008-10-28
2
631 Views
Last Modified: 2012-05-05
Need vbscript  for Creating pdf printer port. This is what I have so far. Assistance or different script is much appreciated.


WshShell.Run "regsvr32 /s \\ServerName\FolderName\Prnadmin.dll",1,TRUE
 
'************** Create the port first *******************************
 
dim oPort,objShell,oMaster,oPrinter,uProfile
 
 
set oPort = CreateObject("Port.Port.1")
Set objShell=CreateObject("WScript.Shell")
uProfile=objShell.ExpandEnvironmentStrings("%USERPROFILE%")
 
set oMaster = CreateObject("PrintMaster.PrintMaster.1")
 
oPort.PortName = uProfile
 
oPort.PortType = 4
 
oMaster.PortAdd oPort
 
if Err <> 0 Then
 
msgbox "There was an error creating the port."
 
end If
 
'********************************************************************
 
'************** Create the printer second ***************************
'Change MyPrinter to the name of the printer that you are adding.
'Change PrinterDriver to the name of the printer driver that you are adding.
 
 
set oPrinter = CreateObject("Printer.Printer.1")
 
oPrinter.PrinterName = "USPTO PDF Publisher"		' name of the printer as it appears in the Printers folder
 
oPrinter.DriverName = "Adobe PDF Converter"		' name that is referenced in ntprint.inf
 
oPrinter.PortName = "uProfile"		' Specify a port name. Can also point to LPT or COM port.
 
oMaster.PrinterAdd oPrinter
If Err <> 0 Then
 
msgbox "There was an error creating the printer."
 
end If
 
 
msgbox "The script is finished."

Open in new window

0
Comment
Question by:Inuyashapl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 125 total points
ID: 22839886
Why do you need to create a printer port? I assume that you want to create PDF documents programatically. There is a better (and documented) way to do that. Are you familiar with the Distiller API reference document?
0
 

Author Comment

by:Inuyashapl
ID: 22852636
I need to create a seperate pdf printer object on pc's that already have adobe acrobat. My need for this is to setup a joboptions template different from adobe's standard for another type of pdf document creation.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
PDF files have been in the limelight due to its unmatched features.  Personal documents, emails, business reports and eBooks are all converted into PDF files owing to peerless features provided by it. Adding watermark to a PDF file is a method to se…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question