Printing pdf or pcl from abap
Hi experts,
may be my problem is to simple, but I can't find an answer in the forum.
I want to print a pdf or pcl (either format will work) on a printer. This printing should happen in an ABAP
program. In this program I get the file via a web service as XSTRING. I also have the destination from the printer in a table from type NAST.
So the question is, what command, program, BAPI, class or whatever can I use to print this file on the
designated printer?
Regards
Torsten
hi
check this
http://help.sap.com/saphelp_nw04/helpdata/en/90/78f081030211d399b90000e83dd9fc/frameset.htm
hope this helps
regards
Aakash Banga
Similar Messages
-
How to print PDF file content from ABAP in background?
Hi,
Is it possible to print PDF file content from ABAP in background?
I have some PDF content which I need to print it, these PDF files are generated outside the SAP.
Please have you any suggestions?
Thank you
Tomas<b><u>Solution:</u></b><br>
<br>
The target output device must support PDF print, this is only one limitation.<br>
<br>
REPORT z_print_pdf.
TYPE-POOLS: abap, srmgs.
PARAMETERS: p_prnds LIKE tsp01-rqdest OBLIGATORY DEFAULT 'LOCL',
p_fname TYPE file_table-filename OBLIGATORY LOWER CASE,
p_ncopi TYPE rspocopies OBLIGATORY DEFAULT '1',
p_immed AS CHECKBOX.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
DATA: lv_rc TYPE i,
lv_filter TYPE string.
DATA: lt_files TYPE filetable.
FIELD-SYMBOLS: <fs_file> LIKE LINE OF lt_files.
CONCATENATE 'PDF (*.pdf)|*.pdf|' cl_gui_frontend_services=>filetype_all INTO lv_filter.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
file_filter = lv_filter
CHANGING
file_table = lt_files
rc = lv_rc
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0 AND lv_rc EQ 0.
MESSAGE 'Error' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
READ TABLE lt_files ASSIGNING <fs_file> INDEX 1.
IF sy-subrc EQ 0.
p_fname = <fs_file>-filename.
ENDIF.
AT SELECTION-SCREEN.
DATA: lv_name TYPE string,
lv_result TYPE boolean.
lv_name = p_fname.
CALL METHOD cl_gui_frontend_services=>file_exist
EXPORTING
file = lv_name
RECEIVING
result = lv_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
IF lv_result NE abap_true.
MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
START-OF-SELECTION.
END-OF-SELECTION.
PERFORM process.
FORM process.
DATA: lv_name TYPE string,
lv_size TYPE i,
lv_data TYPE xstring,
lv_retcode TYPE i.
DATA: lt_file TYPE srmgs_bin_content.
lv_name = p_fname.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = lv_name
filetype = 'BIN'
IMPORTING
filelength = lv_size
CHANGING
data_tab = lt_file
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
MESSAGE 'Read file error!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = lv_size
IMPORTING
buffer = lv_data
TABLES
binary_tab = lt_file
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE 'Binary conversion error!' TYPE 'E' DISPLAY LIKE 'S'.
ENDIF.
PERFORM print USING p_prnds lv_data CHANGING lv_retcode.
IF lv_retcode EQ 0.
WRITE: / 'Print OK' COLOR COL_POSITIVE.
ELSE.
WRITE: / 'Print ERROR' COLOR COL_NEGATIVE.
ENDIF.
ENDFORM. " PROCESS
FORM print USING iv_prndst TYPE rspopname
iv_content TYPE xstring
CHANGING ev_retcode TYPE i.
DATA: lv_handle TYPE sy-tabix,
lv_spoolid TYPE rspoid,
lv_partname TYPE adspart,
lv_globaldir TYPE text1024,
lv_dstfile TYPE text1024,
lv_filesize TYPE i,
lv_pages TYPE i.
CLEAR: ev_retcode.
CALL FUNCTION 'ADS_SR_OPEN'
EXPORTING
dest = iv_prndst
doctype = 'ADSP'
copies = p_ncopi
immediate_print = p_immed
auto_delete = 'X'
IMPORTING
handle = lv_handle
spoolid = lv_spoolid
partname = lv_partname
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CALL FUNCTION 'ADS_GET_PATH'
IMPORTING
ads_path = lv_globaldir.
CONCATENATE lv_globaldir '/' lv_partname '.pdf' INTO lv_dstfile.
OPEN DATASET lv_dstfile FOR OUTPUT IN BINARY MODE.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
TRANSFER iv_content TO lv_dstfile.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CLOSE DATASET lv_dstfile.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CALL FUNCTION 'ZBAP_RM_PDF_GET_PAGES'
EXPORTING
iv_content = iv_content
IMPORTING
ev_pages = lv_pages.
lv_filesize = XSTRLEN( iv_content ).
CALL FUNCTION 'ADS_SR_CONFIRM'
EXPORTING
handle = lv_handle
partname = lv_partname
size = lv_filesize
pages = lv_pages
no_pdf = ' '
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
CALL FUNCTION 'ADS_SR_CLOSE'
EXPORTING
handle = lv_handle
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ev_retcode = 4.
RETURN.
ENDIF.
ENDFORM. " PRINT -
Print pdf file directly from a folder, Adobe Reader X in Windows Server 2003
In previous versions of Adobe Reader we were able to print pdf files groupwise directly when selected in a folder.
Now I've installed Reader X on the Windows Server 2003 environment. Logged in as administrator I can still select <Print> by selecting the right mouse button in a folder. Logged in as a user, this is not available.
I checked user-rights and permissions and made sure they have full control.
Someone who can help us in this matter?
ThanksThanks for your reply.
The file menu doesn't show the print option either. We used to work this way, after installing the 9.0 and Reader X version, this option has disappeared from both the File menu and the right mouse button. For other filetypes, for example Excel the Print option is still available and works properly. Logged in as administrator on the serverconsole, there is no problem. So it seams to be something specific to pdf-formats in a server 2003 environment. The userrights are all set on full control (same as administrator).
Thanks again -
Exctract signatures from PDF with ADS from ABAP
Hello
we have a PDF signed document in ABAP system, we use the Adobe document services and use the Abap object method
if_fp_pdf_object-get_signatures to excract the signature data from an abap program.
The call to adobe document service return the sirnature parsed and only return the next data:
Field Name SFLY Signature 0
Status Cannot check signature
Signatory trustedx-demos
Date and Time Wed Feb 09 2011 07:30:27 GMT+0100 (CET)
Location
Information About Contact
Legal Attestations
Rights (See Interface IF_FP_PDF_SECURITY_PERMISSIONS) All
Reason null
Version 1
Highest Version Still Valid for This Version 1
we need exctract the complete pkcs7 object from the adobe document, not only the parsed data of the signature.
Is there any way to do this from an abap program ????
thanks
regardsHi,
Thanks for the answer, but don't solve our problem, with the method GET_SIGNATURE que ADS return us an xml with the signature data like status of the signature, date, etc.. but we need extract from the pdf objet the complete pkcs7 object.
I supose that ADS internally can do this to extract the signature data, bur the problem is that i don't know if ADS expose this funcionality externally to be called from ABAP system.
Thanks
best Regards
diego -
How can i print data in smartforms from ABAP program.
Dear gurus:
in my abap program i process require data, and saved in a internal table.
how can l print the data in smartforms.?
who can give me a code sample is better:)
reward all helpful advise.Try this....
1) Tcode --> SmartForms
2) Form name --> Z_SF_TEST Create
3) Under Global settings
a) Form Interface
Table Tab
ITAB LIKE EKPO
b) GLOBAL Definitions
WA_NETPR LIKE EKPO-NETPR
In smart forms if we want to display quantity and currency fields. We can't directly display currency field and quantity fields
For that we have to create an extra variable in global definitions
Ex: netpr FIELD of EKPO
CREATE program lines and specify WA_NETWR = itab-netpr.
4) RT CLick on main Window
CREATE --> TABLE
Click Table painter
DEFAULT %LTYPE will be Created
a) If you want more like Header footer etc add by rt click on %LTYPE1
Table (Tab)
%LTYPE Radio(SELECT) 5 CM 5 CM 6 CM
CLICK on DATA (Tab)
INTERNAL TABLE ITAB LIKE ITAB
5)RT click on table control and create --> program lines
General attribute (Tab)
INPUT PARAMETER OUTPUT PARAMETER
itab WA_NETPR
Code Area
WA_NETWR = ITAB-NETPR.
6) RT CLcick on table ctl and create 3 text to display the fields
a) % text1 +button(insert field)
FIELD name &itab-ebeln&
Output options (tab)
Check New line LINETYPE %Ltype1
check new cell
b) % text2
& itab-ebelp&
output options
check new cell
c) % text2
& wa_netpr&
output options
check new cell
<b>Report ac
Tables ekpo.
Data: itab1 like ekpo occurs 0 with header line.
select * into table itab1 from ekpo.
Call function module --> smart form function module and pass your internal table</b>
Regards,
SaiRam -
Printing pdf files made from Filemaker docs on HP 7410 cuts off top margin
Just bought a MacBook Pro and jumped from Tiger to Snow Leopard.
Also bought FileMaker 10 replacing the FileMaker 8.5 I used up till the MacBook Pro purchase and system upgrade.
Still using the same HP 7410, but during installation, I think I remember upgrading the printer driver. At any rate, this HP Printer is now much more responsive. It was previously very slow.
When I now save documents printed as pdf's from filemaker (as I used to) and then try to print them on the HP 7410, they open fine in Preview showing the whole page with no text cut off. But when I press Print in preview and I get the HP driver preview of what will print as part of the print dialogue box, it shows the top margin of the page cut off (down to at least 1/2 ") and actually prints that way. Before the switch to Snow Leopard and the MacBook Pro, a top margin of 1/4 " worked fine and printed in pdf docs.
(top margins of 1/4" on Word & Excel documents I tested still seem to print fine)
I use the borderless printing work-around, but that seems inelegant. It also takes much, much............much longer to print when it's in that mode (even fast draft).
Why is this happening?
Is there a setting I am missing?
Can this be fixed?
SteveWhat print driver are you using?
I set my printer to use the open source Gutenprint driver in place of the one supplied with my printer to resolve an issue I was having - see my post http://discussions.apple.com/thread.jspa?threadID=1626340&tstart=0
The Gutenprint home page is http://gutenprint.sourceforge.net/index.php3
Message was edited by: another_steve -
How to print PDF files directly from SAP?
We have created output that is being saved in a PDF format. We can store it on any drive or send it through email. However, we would like to be able to print a PDF file directIy without any manual intervention. Now users still have to open the file and hit the print button and we want to avoid this. So basically we want to be able to create e.g. a sales order, generate an order confirmation in PDF format and send it directly to the output device that we stored in output master data. I have a feeling it is not possible to print directly because output device has to be like a PDF1 to create the PDF file itself and there is no space left somewhere to store the physical output device. We use ECC 5.
kind regards
Angelique HeutinckYou can use this custom FM -:)
FUNCTION Z_PDF_DOWNLOAD.
*"*"Interfase local
*" IMPORTING
*" REFERENCE(FILENAME) TYPE STRING
SELECT RQIDENT
INTO (T_TSP01-RQIDENT)
FROM TSP01
WHERE RQOWNER EQ SY-UNAME
AND RQCLIENT EQ SY-MANDT.
APPEND T_TSP01.
ENDSELECT.
SORT T_TSP01 DESCENDING.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = T_TSP01-RQIDENT
NO_DIALOG = ''
IMPORTING
PDF_BYTECOUNT = NUMBYTES
PDF_SPOOLID = PDFSPOOLID
BTC_JOBNAME = JOBNAME
BTC_JOBCOUNT = JOBCOUNT
TABLES
PDF = PDF
EXCEPTIONS
ERR_NO_OTF_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DSTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11
OTHERS = 12.
IF SY-SUBRC EQ 0.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = NUMBYTES
FILENAME = FILENAME
FILETYPE = 'BIN'
TABLES
DATA_TAB = PDF
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6.
IF SY-SUBRC EQ 0.
DELETE FROM TSP01 WHERE RQIDENT EQ T_TSP01-RQIDENT.
ENDIF.
ENDIF.
ENDFUNCTION.
Greetings,
Blag. -
It used to be (in Chrome) that I could view a .pdf attachment in gmail and from there print. Now in Firefox, when I view a .pdf attachment the print option is there and the print dialogue box comes up when I click it, but once I hit "OK" nothing comes out of the printer. I can print emails and other items, so it's not a printer connectivity problem or a problem with the print setup in Firefox. The only items affected are .pdf attachments in my gmail account. I've tried switching .pdf readers and turning off Protected Mode in Adobe. Please help!
What PDF reader r u use and what version is it?
-
Directly print PDF form in WebDynpro ABAP
Hello folks,
one little question.
Is it possible to directly print an PDF form in an WebDynpro Abap Application?
Thanks,
AlexI don´t understand your question. You don´t provide much information.
You have 2 options:
1) write a printing program (like non-WDA form etc.) and run it in background
2) tell user to use the Reader embedded in WDA window to print his/her form
Otto -
Can't Print PDF files exported from Pages
I spent all weekend creating a 25 page document - exported it to PDF and it won't print at all. Sent it to 50 customers before I discovered the problem
I used the same fonts and template last year in a document in Version 1 of Pages and had no problems.
I can print directly from Pages and also no problems printing if I export to Word but not PDF which is of course the format I require!
I checked the security setting in Acrobat and none are set so it sould be fine!
Help!?!Can you open and print the the file in Preview? I found Acrobat Reader a little flakey with X and deleted it from my system. I use Preview for everything.
Instead of the export feature have you tried printing to pdf? See if it makes any difference.
Kurt -
Print pdf/wdf files from DMS background
Hi,
need some guidelines for this topic. i have a requirement to print the pdf or dwf files from DMS server.
i have write a program to download the files from DMS to local PC, and call method to print the files. However, this is only applicable to foreground.
is there any way i can do for background?
please advise.
thanks in advance.Thanks for your reply.
The file menu doesn't show the print option either. We used to work this way, after installing the 9.0 and Reader X version, this option has disappeared from both the File menu and the right mouse button. For other filetypes, for example Excel the Print option is still available and works properly. Logged in as administrator on the serverconsole, there is no problem. So it seams to be something specific to pdf-formats in a server 2003 environment. The userrights are all set on full control (same as administrator).
Thanks again -
How to Print PDF in background from SAP directory
Hi,
My PDF file is there in SAP directory, I want to Print the PDF file without opening it . how can i Print in background mode.
Please help me ASAP.
thanks in advanceHey,
i'm having a similar problem here: I want to print a PDF from KW_Storage in background. Any ideas?
Jens -
Hoe can i print pdf report(created from jasper report) without preview
<%@ include file="jsp_connect_db.jsp" %>
<%
//==============================================
//Report Exporting
//==============================================
File reportFile = new File(application.getRealPath("rno0700.jasper"));
Map parameters = new HashMap();
parameters.put("pcourt_running", request.getParameter("pcourt_running"));
parameters.put("ppost_running", request.getParameter("ppost_running"));
parameters.put("ppost_seq", request.getParameter("ppost_seq"));
//parameters.put("ppost_status", request.getParameter("ppost_status"));
//parameters.put("pnotice_type_id", request.getParameter("pnotice_type_id"));
parameters.put("pnotice_date", request.getParameter("pnotice_date"));
parameters.put("BaseDir", reportFile.getParentFile().getPath());
byte[] bytes = JasperRunManager.runReportToPdf(
reportFile.getPath(),
parameters,
conn
//JasperPrint jasperPrint = JasperManager.fillReport(reportFile.getPath(),
//parameters,conn);
response.setContentType("application/pdf");
response.setContentLength(bytes.length);
ServletOutputStream ouputStream = response.getOutputStream();
ouputStream.write(bytes, 0, bytes.length);
ouputStream.flush();
ouputStream.close();
//==============================================
//==============================================
%>Hi,
check this link,this might help you to solve your problem
/people/thomas.jung3/blog/2005/04/28/setting-up-an-adobe-writer-for-abap-output
Regards
Kiran Sure -
Problem with printing pdf file created from Illustrator
Hello,
In a drawing I created with Illustrator 10.0.3 I covered part of a circle with a white rectangle (to make it disappear). I saved it as pdf. When printing the pdf (under Linux with a HP printer), the covered part reappeared. However the pdf-file is how it should be. Anybody knows what the problem is?No, it is not set to overprint. Also, I have to add that the printing results were not consistent. Sometimes it covered and sometimes it did not.
-
Print PDFs from Website Without Header
Is there a way to print PDFs in safari from websites where it does not inclue the header and footer informaition with the website URL, time etc?
In Safari when you hint "Print" it opens up the print dialog. On the bottom you have the point "Print headers and footers." If you don't see the extended print options click on the arrow in the upper right corner.
Maybe you are looking for
-
Kernel panic, then x11.app won't launch.
I had a kernel panic a hour or two ago while doing a bunch of stuff (compiling pkgsrc bootstrap, running virtual pc, and surfing w/firefox), and now X11.app won't launch. The only error messages I can find are in the console log: XFree86 Version 4.4.
-
Need some spec help looking on buying mac pro
Hello I have been looking at getting a Mac for quite some time now I have used Windows all my life and I'm tired of it. I happen to have my birthday coming up and I have all this holiday money set aside for a mac pro. Here is my problem I only have a
-
MEMORY_PGFREE_FAILED?
Hi experts, I got an error MEMORY_PGFREE_FAILED when I ran a customized program which consumes a lot of memory. It usually showed TSV_TNEW_PAGE_ALLOC_FAILED before. Maybe after I adjust some parameters in profile, the error message is changed now.
-
SRKIM: Rel.11i- PA- GL_IMPORT_REFERENCES mapping with Project Transaction
Purpose ===== R11i: Project Transaction 이 GL Journal 로 import 되었을 시 mapping 하는 방법에 대해 알아 보도록 한다. Question ===== 11i 에서 Project Transaction 을 GL 로 Transfer 후 reconcile 을 위해 gl_import_references table 과 mapping 을 하고 싶다. 어떻게 mapping 해야 하는가. Answer =====
-
Removing gray crappy ugly Applet loader background
excuse my language but I've spent the last two days tring to figure out how to remove the gray screen when the applet loads in a browser... I've searched the forums, found other ppl with same problem but no real solutions... from what I found: 1. usi