How to suppress "Save PDF File As" when print to "Adobe PDF" printer

This is a multi-part message in MIME format.

------=_NextPart_000_0096_01C4B814.07C82370
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_0097_01C4B814.07C82370"


------=_NextPart_001_0097_01C4B814.07C82370
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Clear DayPlease help: How to send datawindow to Adobe PDF printer, =
suppress the "Save PDF File As", pass the PDF file name, then send mail =
with attachment by Outlook with a specific user name, password, and =
recipient name.
Thanks.

------=_NextPart_001_0097_01C4B814.07C82370
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE id=3DridTitle>Clear Day</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252"><BASE=20
href=3D"file://C:\Program Files\Common Files\Microsoft =
Shared\Stationery\">
<STYLE>BODY {
	MARGIN-TOP: 25px; FONT-SIZE: 10pt; MARGIN-LEFT: 10px; COLOR: #0033cc; =
FONT-FAMILY: Arial, Helvetica
}
</STYLE>

<META content=3D"MSHTML 6.00.2900.2523" name=3DGENERATOR></HEAD>
<BODY id=3DridBody bgColor=3D#ffffff=20
background=3Dcid:009101c4b84e$b4224080$2314960a@pdecc.ladwp.com>
<DIV>Please help: How to send datawindow&nbsp;to Adobe PDF printer, =
suppress the=20
"Save PDF File As", pass the PDF file name, then send mail with =
attachment by=20
Outlook with a specific&nbsp;user&nbsp;name,&nbsp;password, and =
recipient=20
name.</DIV>
<P>Thanks.</P></BODY></HTML>

------=_NextPart_001_0097_01C4B814.07C82370--

------=_NextPart_000_0096_01C4B814.07C82370
Content-Type: image/jpeg;
	name="Clear Day Bkgrd.JPG"
Content-Transfer-Encoding: base64
Content-ID: <009101c4b84e$b4224080$2314960a@pdecc.ladwp.com>

/9j/4AAQSkZJRgABAgEASABIAAD/7QVoUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA
AQBIAAAAAQABOEJJTQPzAAAAAAAIAAAAAAAAAAA4QklNBAoAAAAAAAEAADhCSU0nEAAAAAAACgAB
AAAAAAAAAAI4QklNA/UAAAAAAEgAL2ZmAAEAbGZmAAYAAAAAAAEAL2ZmAAEAoZmaAAYAAAAAAAEA
MgAAAAEAWgAAAAYAAAAAAAEANQAAAAEALQAAAAYAAAAAAAE4QklNA/gAAAAAAHAAAP//////////
//////////////////8D6AAAAAD/////////////////////////////A+gAAAAA////////////
/////////////////wPoAAAAAP////////////////////////////8D6AAAOEJJTQQIAAAAAAAQ
AAAAAQAAAkAAAAJAAAAAADhCSU0ECQAAAAAD9wAAAAEAAACAAAAAgAAAAYAAAMAAAAAD2wAYAAH/
2P/gABBKRklGAAECAQBIAEgAAP/+ACdGaWxlIHdyaXR0ZW4gYnkgQWRvYmUgUGhvdG9zaG9wqCA0
LjAA/+4ADkFkb2JlAGSAAAAAAf/bAIQADAgICAkIDAkJDBELCgsRFQ8MDA8VGBMTFRMTGBEMDAwM
DAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAENCwsNDg0QDg4QFA4ODhQUDg4ODhQRDAwM
DAwREQwMDAwMDBEMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8AAEQgAgACAAwEiAAIRAQMR
Af/dAAQACP/EAT8AAAEFAQEBAQEBAAAAAAAAAAMAAQIEBQYHCAkKCwEAAQUBAQEBAQEAAAAAAAAA
AQACAwQFBgcICQoLEAABBAEDAgQCBQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIjJBVS
wWIzNHKC0UMHJZJT8OHxY3M1FqKygyZEk1RkRcKjdDYX0lXiZfKzhMPTdePzRieUpIW0lcTU5PSl
tcXV5fVWZnaGlqa2xtbm9jdHV2d3h5ent8fX5/cRAAICAQIEBAMEBQYHBwYFNQEAAhEDITESBEFR
YXEiEwUygZEUobFCI8FS0fAzJ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tHFDWKGsKt4EtiuKt4q//9k=

------=_NextPart_000_0096_01C4B814.07C82370--

0
QT
10/22/2004 3:49:28 PM
sybase.powerscript 7704 articles. 0 followers. Follow

4 Replies
1341 Views

Similar Articles

[PageSpeed] 55

I tried a couple of things and could not find a way to turn it off.  There may
be something in Acrobat that caould turn it off.  Not sure.... anyone else have
success?

On 22 Oct 2004 08:49:28 -0700,
 in sybase.public.powerbuilder.powerscript
QT <nospam@domain.com> wrote: 
>Clear DayPlease help: How to send datawindow to Adobe PDF printer, suppress the
"Save PDF File As", pass the PDF file name, then send mail with attachment by
Outlook with a specific user name, password, and recipient name.
>Thanks.
>
0
Andy
10/22/2004 4:51:07 PM
Adobe 5 I have working, but Adobe 6 I've never been able to figure out how
to do it.

-- 
Terry Dykstra (TeamSybase)
http://powerbuilder.codeXchange.sybase.com/
http://www.pb9books.com
product enhancement requests:
http://www.isug.com/cgi-bin/ISUG2/submit_enhancement


"Andy Turiansky [TeamSybase]" <aturiansky@comcast.net> wrote in message
news:41793a77$1@forums-2-dub...
> I tried a couple of things and could not find a way to turn it off.  There
may
> be something in Acrobat that caould turn it off.  Not sure.... anyone else
have
> success?
>
> On 22 Oct 2004 08:49:28 -0700,
>  in sybase.public.powerbuilder.powerscript
> QT <nospam@domain.com> wrote:
> >Clear DayPlease help: How to send datawindow to Adobe PDF printer,
suppress the
> "Save PDF File As", pass the PDF file name, then send mail with attachment
by
> Outlook with a specific user name, password, and recipient name.
> >Thanks.
> >


0
Terry
10/22/2004 7:35:17 PM
You must go to the printing preferences of the adobe printer.  Go to Adobe PDF
Settings and uncheck the "Prompt For PDF File Name" and uncheck "Ask To Replace
Existing PDF File."  Hope this helps.



On 22 Oct 2004 12:35:17 -0700,
 in sybase.public.powerbuilder.powerscript
Terry Dykstra <tddykstra@forestoil.ca> wrote: 
>Adobe 5 I have working, but Adobe 6 I've never been able to figure out how
>to do it.
>
>-- 
>Terry Dykstra (TeamSybase)
>http://powerbuilder.codeXchange.sybase.com/
>http://www.pb9books.com
>product enhancement requests:
>http://www.isug.com/cgi-bin/ISUG2/submit_enhancement
>
>
>"Andy Turiansky [TeamSybase]" <aturiansky@comcast.net> wrote in message
>news:41793a77$1@forums-2-dub...
>> I tried a couple of things and could not find a way to turn it off.  There
>may
>> be something in Acrobat that caould turn it off.  Not sure.... anyone else
>have
>> success?
>>
>> On 22 Oct 2004 08:49:28 -0700,
>>  in sybase.public.powerbuilder.powerscript
>> QT <nospam@domain.com> wrote:
>> >Clear DayPlease help: How to send datawindow to Adobe PDF printer,
>suppress the
>> "Save PDF File As", pass the PDF file name, then send mail with attachment
>by
>> Outlook with a specific user name, password, and recipient name.
>> >Thanks.
>> >
>
>
0
Brian
10/26/2004 1:39:52 PM
Answers are inline...

> >On 22 Oct 2004 08:49:28 -0700,
> > in sybase.public.powerbuilder.powerscript
> >QT <nospam@domain.com> wrote:
> >Clear DayPlease help: How to send datawindow to Adobe PDF printer,

If the user of the program selects the "Acrobat Distiller" printer manually,
you just need to issue a regular PrintDatawindow( ) funtion.  This will
cause the DW to be printed into a PDF file.  If you want the printer
selection to be taken care of by the program, do the following...

  //Gets the default printer
  ls_default = PrintGetPrinter()

  //Gets the Printers on the computer
  ls_printers = PrintGetPrinters( )

  //Finds the Distiller printer
  ll_pos = Pos(ls_printers, "Acrobat Distiller")

  //Gets the location of the Distiller printer
  ls_printer = Mid(ls_printers, ll_pos, Pos(ls_printers, "~n", ll_pos) -
ll_pos)

  //Sets our next print job to print to Distiller
  PrintSetPrinter(ls_printer)

  job = PrintOpen( )
  PrintDataWindow(job, DW)
  PrintClose(job)

  //Sets the default printer back
  PrintSetPrinter(ls_default)


> > suppress the "Save PDF File As",

Go to your Printers list in Windows.  Right click on "Acrobat Distiller" and
select Properties.  Click the Printing Preferences button.  Click the Adobe
PDF Settings tab.  Uncheck "View Results in Acrobat" and "Prompt for the PDF
Filename".

Also run the Acrobat Distiller program and click on the File > Preferences
menu.  Uncheck "Ask for PDF file destination" and "View PDF when using
Distiller".


> > pass the PDF file name,

I could not figure out how to pass the PDF file name, so I just rename the
PDF file that gets created to the name I want.  To do this you must know
where the PDF files are being created.  For Acrobat version 4.0 and lower, I
believe all PDFs go to the "PDF Output" folder that is located under the
Acrobat program folders.  For Acrobat version 5.0 and higher, you specify
where the files will be created.  This is done by going to your Printers
list in Windows.  Right click on "Acrobat Distiller" and select Properties.
Click on the PORTS tab.  In here it will list the path where the files will
be saved.  If you don't like the default location, click the ADD PORT
button, add a new PDF port, and select where you want the files to be saved.
Then just make sure the correct "port" is checked.

The PDF files created from PB are named "PowerBuilder.pdf" so this is what I
do...

//Declaration to be put in Global External Functions
function boolean MoveFileA(string LpExistingFileName, string LpNewFileName)
library 'kernel32.dll'

  //Wait for PDF file to be created if neccessary (I used a timer)

  //Sets up variable to proper values
  ls_filename = "Incident_" + string(Message.DoubleParm) + ".pdf"
  ls_old_name = "C:\adobe acrobat\PDF Output\PowerBuilder.pdf"
  ls_new_name = "C:\adobe acrobat\PDF Output\" + ls_filename
  ls_textfile = "C:\adobe acrobat\PDF Output\PowerBuilder.txt"

 //Removes file if it already exists
 if (FileExists(ls_new_name)) then
  FileDelete(ls_new_name)
 end if

 //Deletes text file
 FileDelete(ls_textfile)

 // Rename the old filename to the new filename
 IF NOT MoveFileA (ls_old_name, ls_new_name) THEN
   MessageBox ("RENAMING ERROR", "An error has occured during the" + &
               " renaming of~n" + ls_old_name + "~nto~n" +ls_new_name)
 END IF


> > then send mail with attachment by
> >Outlook with a specific user name, password, and recipient name.
> >Thanks.
> >

As for sending it through Outlook, check out the following code.  Ignore any
code that may be specific to my app.  Also, to get past the security warning
that Outlook pops up when you try to send the email through PB, I use a
nifty little utility called ClickYes! found at
http://www.contextmagic.com/express-clickyes/ .



mailSession  mSes
mailReturnCode  mRet
mailMessage  mMsg
mailMessage  mNull
mailFileDescription  mAttach

//Variables for PB
long ll_pos
string ls_email
string ls_hold
int li_items
string ls_file
string ls_error
string ls_profile
int li_incident
int li_site
int li_counter
int li_recipient
string ls_name = ""
string ls_incident
string ls_temp
string ls_person1
string ls_person2
string ls_person3
string ls_person4
string ls_person5
string ls_person6
string ls_person7
string ls_person8
string ls_path
boolean lbl_error = false

SetPointer(HourGlass!)

//Obtains the Profile name
RegistryGet('HKEY_CURRENT_USER\Software\Microsoft\Windows
NT\CurrentVersion\Windows ' &
          + 'Messaging Subsystem\Profiles', 'DefaultProfile', RegString!,
ls_profile)

if (gbl_winNT) then
 ls_path = "C:\Program Files\Adobe\Acrobat 4.0\PDF Output\"
else
 ls_path = "C:\Adobe Acrobat\PDF Output\"
end if

//Populates the list box with all the files ready to be exported
lb_pdf.DirList (ls_path + "*.pdf", 0)

//Counts the number of items in the listbox
li_items = lb_pdf.TotalItems()

if (li_items = 0) then
 sle_status.text = "E-mail Sent"
 this.Title = "E-MAILING COMPLETE"
 SetPointer(arrow!)
 return
end if

// Create a mail session
mSes = create mailSession

// Log on to the session
mRet = mSes.mailLogon (ls_profile, "", mailnewsession!)
IF mRet <> mailReturnSuccess! THEN
 MessageBox ("E-mail Error", 'Logon failed.', StopSign!)
 destroy mSes
 RETURN
END IF

for li_counter = 1 to li_items

 //Nulls out the MailMessage
 mMsg = mNull

 //Selects an item and puts the name into a string
 lb_pdf.SelectItem (li_counter)
 ls_file = lb_pdf.SelectedItem()

 sle_status.text = "Gathering E-mail message and attachment information..."

 //Selects an item and puts the name into a string
 ls_hold = ls_file

 //Gets the Incident #
 ll_pos = Pos(ls_file, "_")
 ls_incident = Mid(ls_file, ll_pos + 1, Pos(ls_file, ".") - ll_pos - 1)

 //Reassigning the incident #
 li_incident = integer(ls_incident)

 //Gets the Site # from the Incident Report
 select site_num
  into :li_site
  from incident
  where incident_num = :li_incident;

 //Gets the Email List for the particuliar site
 select person1, person2, person3, person4, person5, person6, person7,
person8
  into :ls_person1, :ls_person2, :ls_person3, :ls_person4, :ls_person5,
     :ls_person6, :ls_person7, :ls_person8
  from email_list
  where loc_num = :li_site;

 //Initializes
 li_recipient = 1

 //As long as there's is a name, we continue
 if (not isNull(ls_person1)) then

  //Gets the Email address of the person
  select email_address
   into :ls_email
   from email_address
   where email_name = :ls_person1;

  //Specifies the recipient of the current message.
  mMsg.Recipient[li_recipient].name = Trim(ls_email)
  mMsg.Recipient[li_recipient].recipientType = mailto!
  li_recipient++

  //Checks for errors
  if (ls_email = "" OR isNull(ls_email)) then
   lbl_error = true
   goto ERROR
  end if

  //Compiles Recipient list
  if (ls_name = "") then
   ls_name += ls_person1
  else
   ls_name = ls_name + ", " + ls_person1
  end if

 end if

/*  Took out code that went through other 'ls_person2-8', it's the same and
you should get the point.  */

sle_status.text = "Transfering E-mail with Incident #" + ls_incident + " to
" &
                  + ls_name + "..."

 ERROR:

 //If no email address is retrieved then an error list is created and
 //the file for that Hauler is not sent
 if (lbl_error) then

  ls_error = ls_error + ls_hold + ", "
  sle_status.textcolor = RGB(255,0,0)
  sle_status.text = "E-mail address not found."
  this.Title = "ERROR ENCOUNTERED"
  goto STOP

 end if

 //Specifies the content of the message body. (Runtime only.)
 mMsg.NoteText = "~r~nThe attached file contains a new Incident Report." &
      + "~r~n~r~nView the file using ADOBE ACROBAT READER.~r~n~r~n" &
      + "If you do not have ADOBE ACROBAT READER, you can download " &
      + "it at the following web link...~r~n " &
      + "http://www.adobe.com/products/acrobat/readstep2.html~r~n"

 //Specifies the type of the attachment file. Values are:mailAttach! (data
file)
 mAttach.FileType = mailAttach!
 //Specifies the full path of the attachment file.
 mAttach.PathName = ls_path + ls_file
 //Specifies the name of the attachment file.
 mAttach.FileName = ls_file
 //Specifies the subject of the email
 mMsg.Subject = "New Incident Report #" + ls_incident + " sent " + string
(Today())

 // Specifies the position of the attachment file within the message body.
(Read only.)
 // This will place the attachment at the End of the text of the message
 mAttach.Position = len(mMsg.notetext) - 1
 //Specifies the file attachment for the current message. A
mailFileDescription array
 //contains information about an attachment file.
 mMsg.AttachmentFile[1] = mAttach

 sle_status.text = "Sending E-mail..." + ls_file

 // Send the mail
 mRet = mSes.mailSend ( mMsg )

 //Checks to make sure the mail was sent successfully
 IF mRet <> mailReturnSuccess! THEN

  MessageBox("E-mail Error", 'There was a problem sending the E-mail' &
    + '.~n~nE-mail not sent.', StopSign!)
  sle_status.text = "E-mail Error!"
  GOTO STOP
 END IF

 post FileDelete (ls_path + ls_file)

 SetPointer(hourglass!)

next

STOP:

sle_status.text = "E-mail Sent"

/*Ends the mail session, breaking the connection between the PowerBuilder
application and mail. If the mail application was already running when
PowerBuilder
began the mail session, it is left in the same state.*/
mSes.mailLogoff()

//DESTROY the Mail session that was created with the CREATE statement.
DESTROY mSes

/***************************************************************************
***/


Hope this helps.

Shenn Sellers
Riverside County Waste Management
NOSPAM_ssellers@co.riverside.ca.us



0
Shenn
11/2/2004 12:13:30 AM
Reply:

Web resources about - How to suppress "Save PDF File As" when print to "Adobe PDF" printer - sybase.powerscript

Resources last updated: 12/21/2015 7:41:08 PM