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
Bugs happen :-)

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
Bugs happen :-)

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
Here is an example of using the Acrobat reader Activex.

       IDENTIFICATION               DIVISION.
       PROGRAM-ID.                  TEMPLATE.
       ENVIRONMENT                  DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY "AcroPDF.def".
           .
       FILE-CONTROL.
           SELECT  MYPRINT          ASSIGN TO "-P SPOOLER"
                   ORGANIZATION     IS LINE SEQUENTIAL.
                   
       FILE        SECTION.
       FD  MYPRINT.
       01  PLINE                    PIC X(80).
                   
       WORKING-STORAGE SECTION.
       77  CNTL-FONT                USAGE HANDLE OF FONT SMALL-FONT.
       77  KEY-STATUS               IS SPECIAL-NAMES
           CRT STATUS               PIC 9(4) VALUE 0.
           88  EXIT-PRESSED         VALUE 27.
       SCREEN      SECTION.
       01  TEMPLATE-SCREEN.
    03      MyPDF            AcroPDF
            LINE             1
            COL              1
            SIZE             130
            LINES            40.
           
           03      PUSH-BUTTON
                   LINE             42
                   COL              63
                   SIZE             14
                   TITLE            "E&xit"
                   SELF-ACT
                   EXCEPTION-VALUE  = 27.
       PROCEDURE DIVISION.
       MAIN-LOGIC.
           DISPLAY STANDARD         GRAPHICAL WINDOW
                   TITLE            "Template"
                   CONTROL          FONT CNTL-FONT
                   SIZE             132
                   LINES            45
                   FONT             CNTL-FONT
                   BACKGROUND-LOW.
           DISPLAY TEMPLATE-SCREEN.
           MODIFY  MyPDF            LoadFile("c:\\movies.pdf").
           PERFORM WITH TEST AFTER  UNTIL EXIT-PRESSED
                   ACCEPT           TEMPLATE-SCREEN
           END-PERFORM.
           DESTROY TEMPLATE-SCREEN.
           STOP    RUN.


If i try to view something in debug mode it is working!

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
The MAV dialog refers to EMMSCR, UTSCREEN, FAAAFF2 and utmenu. Does it mean you do not get this error using the example code you listed?

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
The MAV dialog refers to EMMSCR, UTSCREEN, FAAAFF2 and utmenu. Does it mean you do not get this error using the example code you listed?

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
This his the code a used and if i execute that in debug it is perfect and whitout debug his crash when i used the tab key




display standard graphical window,
SCREEN LINE 1
SCREEN POSITION 1
title "L.C.M. Global"
SIZE 130,
LINES 30,
BACKGROUND-LOW,
background-COLOR 7,
COLOR 2
visible TRUE
* MIN-SIZE LC-SCREEN-MIN-SIZE,
* MIN-LINES LC-SCREEN-MIN-LINES,
* MAX-SIZE 180,
* MAX-LINES 53,
* modeless, link to thread,
HANDLE MAIN-WINDOW-HANDLE

DISPLAY ACROPDF
LINE 1
POSITION 1
SIZE 120
LINES 27
VISIBLE TRUE
*************** EVENT 201-EVENT THRU 201-EXIT
HANDLE IS PDF-HANDLE


MODIFY PDF-HANDLE
LoadFile("D:\\LCM\\PDF\\1.PDF")
ACCEPT PDF-HANDLE VALUE FIELD
ON EXCEPTION CTRL-KEY CONTINUE
END-ACCEPT
DESTROY PDF-HANDLE.
DESTROY MAIN-WINDOW-HANDLE.

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
This his the code a used and if i execute that in debug it is perfect and whitout debug his crash when i used the tab key




display standard graphical window,
SCREEN LINE 1
SCREEN POSITION 1
title "L.C.M. Global"
SIZE 130,
LINES 30,
BACKGROUND-LOW,
background-COLOR 7,
COLOR 2
visible TRUE
* MIN-SIZE LC-SCREEN-MIN-SIZE,
* MIN-LINES LC-SCREEN-MIN-LINES,
* MAX-SIZE 180,
* MAX-LINES 53,
* modeless, link to thread,
HANDLE MAIN-WINDOW-HANDLE

DISPLAY ACROPDF
LINE 1
POSITION 1
SIZE 120
LINES 27
VISIBLE TRUE
*************** EVENT 201-EVENT THRU 201-EXIT
HANDLE IS PDF-HANDLE


MODIFY PDF-HANDLE
LoadFile("D:\\LCM\\PDF\\1.PDF")
ACCEPT PDF-HANDLE VALUE FIELD
ON EXCEPTION CTRL-KEY CONTINUE
END-ACCEPT
DESTROY PDF-HANDLE.
DESTROY MAIN-WINDOW-HANDLE.

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
Try adding an enter-able field (entry-field) to your screen.

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
Try adding an enter-able field (entry-field) to your screen.


I do not understand !
I search for enter-able and find nothing!
Could you please be more clear
Thank you! to respond to my posted!

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
Try adding an enter-able field (entry-field) to your screen.


I do not understand !
I search for enter-able and find nothing!
Could you please be more clear
Thank you! to respond to my posted!

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
The screen has no input target. Dilbert suggest you should add an entry field to see if the error goes away.

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
The screen has no input target. Dilbert suggest you should add an entry field to see if the error goes away.

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
Hello Rob,

May I ask you the same qeustion that Patty Stepp did, and that is, if you want share some cobolcode with me in a Cutepdf project. I, and my customers, use already a lot of years PDFCreator(there are a view more options than Cutepdf), but there is for example the possibilty to cancel a print and than you have nothing. To avoide this it is nesseary that a pdf file is saved without itterfering of the user. I looked at the com object of PDFCreator but my knowledge is not enough to build this in, or you must have some idee's? So I think that cutepdf is eayser to use.

I hope you can help me. Thanks already.