cancel
Showing results for 
Search instead for 
Did you mean: 

Printout a pdf file in a specific printer.

Former Member
0 Kudos

Hi experts,

I am facing the following problem: I have a PDF file that i want to print without using a user interface to do it. I created a database table where I store the name of the PDF file that I need to print, the type is BDS_FILENA. Now at a certain hour I want to send the PDF file to be printed in a specific printer installed in the network. The idea is to create the code that sends out the files only by giving the file name.

I already have the PDF file uploaded in the system (is not a local file I want to print).

I know that using the FM GET_PRINT_PARAMETERS I am able to config whether the IMMEDIATELY, NO_DIALOG, DEVICE (printer name), etc.

My question is, by calling this FM it will send the spool defined in the DATA_SET parameter to the printer??? how can I add the document to the spool (I am assuming that the DATA_SET is the spool where the documents are ready to be printed... Am I right?) By calling this FM, automatically will start the print due to I have defined the IMMEDIATELY parameter as 'X' right or do I have to call another FM to start the printing?

I have check these forums: [Thread 1|http://www.sapfans.com/forums/viewtopic.php?f=13&t=23697&start=0&st=0&sk=t&sd=a], [Thread 2|] but I am not too sure about if it is what I need.

Can you please guide me a little bit about it?

In advance, thanks a lot for your comments or observations.

Cheers,

Mauricio.-

Accepted Solutions (0)

Answers (2)

Answers (2)

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi,

Have a look at fm RSPO_OUTPUT_SPOOL_REQUEST

Former Member
0 Kudos

Thanks for both answers,

the first option is not a solution for what I am attempting to do. The calling to the RSPO_OUTPUT_SPOOL_REQUEST seems to be more likely, I will study about that and come back with any question I could have or to close the thread and share the point.

Once again, thanks to both of you for the quick reply. I really appreciate.

Sandra_Rossi
Active Contributor
0 Kudos

RSPO_OUTPUT_SPOOL_REQUEST just sends a spool to the printer. If you store the PDF as a spool (using RSPO_OPEN_SPOOLREQUEST, RSPO_WRITE_SPOOLREQUEST (loop to write text), RSPO_CLOSE_SPOOLREQUEST, RSPO_PAGE_BREAK_SPOOLREQUEST function modules for example), then prints it, if your printer doesn't accept PDF format, it won't work.

Former Member
0 Kudos

Hi again,

Ok, I have read about the RSPO_*_SPOOLREQUEST FM, but in non of them I figure out what is the FM that I need to call to send the spool to the printer...

RSPO_OPEN_... will return the spool number. that spool number I will need to pass as SPOOL_REQUEST_ID parameter in the RSPO_OUTPUT_SPOOL_REQUEST right?

I understood that I will have to convert the PDF into a spool, i don't know yet how to do it... but it is something that seems to be easy, but the printer side I cannot understand. Using those calls I am able to convert the PDF from hte XSTRING type to a spool. but after the conversion, how do I send to document to the printer?? I don't need to download it to a local computer, i just need to printout the PDF or the data inside the PDF with all the layout (Title, headers, footers, etc.)

In advance, thanks again.

Sandra_Rossi
Active Contributor
0 Kudos

But it's useless to store the PDF as a spool, if the printer doesn't understand PDF format.

So, first, buy a "PDF" printer. If you want to use a postscript printer, get a software which converts PDF to postscript. Etc.

The spool is just a container.

You may store the PDF into a spool using the FMs I mentioned. By the way, I remember of some limits of these FMs, they added some dummy bytes every approximately 700 bytes...

A simpler way to send a file to the printer is to store the file in the OS file system and use an OS command LPR or something like that, depends of the OS (check with your admin).

Sandra_Rossi
Active Contributor
0 Kudos

This function module is not used for printing, it's just to retrieve print parameters for printing lists.

DATA_SET is to enter the name of the spool, it's just an attribute for identifying spools.

Your threads don't give useful information about your issue.

If you want to print PDF files, you may either use a printer that accepts PDF format, and send the file to the printer without transformation (check the printer documentation). But most of printers accept only PS and PCL formats so you have to convert PDF to one of these formats, SAP doesn't do that, you have to use a third-party software. Another solution is to send the file to an output management system (like HP/Dazel, Streamserve). A last solution is to use a Windows server (store the pdf on that computer and call acrord32.exe (adobe acrobat reader) with adequate parameters to print this file directly).