Skip to main content

[archive] Create PDF with File Name Specified

  • May 23, 2006
  • 88 replies
  • 2 views

Show first post

88 replies

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
OK, so like this then?

MOVE "start C:\\thefile.pdf" TO WS-FILENAME

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
OK, so like this then?

MOVE "start C:\\thefile.pdf" TO WS-FILENAME

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Apologies, I changed our method to

move spaces to COMMAND-NAME.
INSPECT image-path REPLACING TRAILING SPACES BY "£".
string '"' image-path delimited by "£"
'"' delimited by size
into COMMAND-NAME.
CALL "C$SYSTEM" USING COMMAND-NAME 97.

Placing the filename in the single quotes solves your problem.

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Thanks,

I actually nicked you're code in the first place.

Do you run thin client on Unix?

I'll try running on Windows thin client later.

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Thanks,

I actually nicked you're code in the first place.

Do you run thin client on Unix?

I'll try running on Windows thin client later.

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
No - only distribute our product on Windows.
Keith

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
No - only distribute our product on Windows.
Keith

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Shaun,

We run thin client on UNIX and have used start in the exact manner you showed with no problems. This is strange because as long as the CSYS-DESKTOP flag is set, I've always seen it work...

Rob

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Thanks Rob,

It is strange.

I don't suppose I could ask a favour from you?

See if you can make it work on your system.
The attachment contains a 7.2.0 compiled object, a pdf file to save in c:\\ and a .psf file incase you want to change something.

Much appreciated if you can, completly understand if you can't

In this version "start" is removed, but thats all.

Thanks,

Shaun

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Thanks Rob,

It is strange.

I don't suppose I could ask a favour from you?

See if you can make it work on your system.
The attachment contains a 7.2.0 compiled object, a pdf file to save in c:\\ and a .psf file incase you want to change something.

Much appreciated if you can, completly understand if you can't

In this version "start" is removed, but thats all.

Thanks,

Shaun

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Shaun,

It worked for me on Windows, but not on thin client. I get a "-1" in the status. I'll mess around with it and see if I can make it work for me.

Rob

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Shaun,

It worked for me on Windows, but not on thin client. I get a "-1" in the status. I'll mess around with it and see if I can make it work for me.

Rob

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Shaun,

I got it to work by adding the Shell and Hidden flags to the IS-REMOTE logic. So, my IS-REMOTE logic and the other logic are identical instead of the CSYS-DESKTOP flag. And for that matter, you could just keep that for both. Which means you wouldn't need the IF statement.

Rob

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Thanks Rob,

Very much appreciated.

Shaun

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Thanks Rob,

Very much appreciated.

Shaun

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
I have also started using the programming version of cutepdf recently and it works great on our development PCs and most client PCs. Thanks to all for your comments and help.
I do have one problem that has been showing up and I was wondering if anyone has come across this. On one of our client's PC running Windows XP when the COBOL code gets to OPEN OUTPUT PRINTER-FILE statement it crashes the ACUCOBOL-GT runtime every time. On other PCs it works great. I don't want to just blame it on the PC but it's got me stumped.
Any help would be much appreciated.
Wes

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
I have also started using the programming version of cutepdf recently and it works great on our development PCs and most client PCs. Thanks to all for your comments and help.
I do have one problem that has been showing up and I was wondering if anyone has come across this. On one of our client's PC running Windows XP when the COBOL code gets to OPEN OUTPUT PRINTER-FILE statement it crashes the ACUCOBOL-GT runtime every time. On other PCs it works great. I don't want to just blame it on the PC but it's got me stumped.
Any help would be much appreciated.
Wes

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Hi Wes,
1) check if the OS (the printer) device assigned to ACU "PRINTER" variable is available and ready.
2) have You inserted the PRINTER-FILE in declaratives to have code control of printer status?
3) if client OS is a Win9x or WinXp and You setted PRINTER-FILE to -P SPOOLER-DIRECT assigning it to a certain Windows device check on client control panel if there's a printer in some kind of error (for ex. a printer that was formerly installed and that now it's no more availble on the system, control panel flags it showing a "error..." status short decription under it's icon. Even if your program doesen't use it, runtime browse devices before using it so if it crosses one of them in error it crashes in an unexpected and uncontrollable manner.
hope it helps, bye Gio

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Hi Wes.
This is what I would check.
Can you go into word or another application and type in a test document and print it to the cutepdf printer. Sounds to me like this PC does not have the printer installed so they can access it. I would make sure it is working outside of your program before I would change your program.

Outside of your program, I may not auto save the file so you will have to type in a file name. However, it should create a pdf.

Patty

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Hi Wes.
This is what I would check.
Can you go into word or another application and type in a test document and print it to the cutepdf printer. Sounds to me like this PC does not have the printer installed so they can access it. I would make sure it is working outside of your program before I would change your program.

Outside of your program, I may not auto save the file so you will have to type in a file name. However, it should create a pdf.

Patty

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Are all your calls to WIN$PRINTER successful before you attempt to open the cutepdf printer? Does WINPRINT-GET-PRINTER-INFO-EX work ok for the cutepdf printer?

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Are all your calls to WIN$PRINTER successful before you attempt to open the cutepdf printer? Does WINPRINT-GET-PRINTER-INFO-EX work ok for the cutepdf printer?

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Thanks for all your suggestions.

There are no errors with any printers installed on this computer.

The calls to WIN$PRINTER prior to the OPEN statement don't return any errors.

We have the declarative set up for the PRINTER so I displayed the file status and it shows a permanent error on the OPEN OUTPUT statement.

We tried printing from Word and it crashes just like from our program.
I reinstalled the driver and tried it again but it crashed again.

I guess I'll check with Acro Software to see if they have encountered this problem.
At least I know it's not our programs. whew

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Just thought I'd let you know that after working with Acro Software support for several weeks, they sent me another version of their custom program and now it works fine.
Not sure why it wasn't working.
Again thanks for the help!

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 23 May 2006]

I am able to create a PDF file using "Adobe PDF" as a printer.
However, it automatically goes to the "Save As" dialog when the printer is opened. I want to assign my own file name each time I run the report, then create the PDF, and exit the program. I will then use a system call to view the pdf or attach it to an email it in outlook. I cannot use the temporary file method as I am using win$printer to add a logo and line drawing. I would rather not use active x to create the entire report as that would be too tedious.

Does anyone have a method to accomplish this task? If so, can you also share your code on how you bypass the dialog, and pass the file name. If I cannot bypass the view, I could live with that.

Thanks
Patty
Just thought I'd let you know that after working with Acro Software support for several weeks, they sent me another version of their custom program and now it works fine.
Not sure why it wasn't working.
Again thanks for the help!