2024 Oct 15 6:01 PM - edited 2024 Oct 16 9:12 AM
Hello experts,
I am facing a problem when printing PDFs in ABAP. The PDFs are available as originals for documents and can be opened via transaction CV02N, for example.
Printing works in principle, I do this using ADS_SR_OPEN, ADS_SR_CONFIRM etc.
Now to my problem: Some PDFs are in A4 format, others in A3 format. When printing, however, everything is automatically set to A4, which means that content is cut off for larger formats.
How can I ensure that the PDFs are always printed in the correct format (A4 or A3)?
To make matters worse, I don't know which format a PDF is in before printing.
Many thanks in advance for your help!
Janik
EDIT:
Here is my code:
CALL FUNCTION 'ADS_SR_OPEN'
EXPORTING
dest = i_printer
doctype = 'ADSP'
IMPORTING
handle = handle
partname = partname.
CALL FUNCTION 'ADS_GET_PATH'
IMPORTING
ads_path = path.
CONCATENATE path '/' partname '.pdf' INTO file.
OPEN DATASET file FOR OUTPUT IN BINARY MODE.
TRANSFER i_pdf_xstring TO file.
CLOSE DATASET file.
DATA filesize TYPE i.
filesize = xstrlen( i_pdf_xstring ).
CALL FUNCTION 'ADS_SR_CONFIRM'
EXPORTING
handle = handle
partname = partname
size = filesize
pages = 1.
CALL FUNCTION 'ADS_SR_CLOSE'
EXPORTING
handle = handle.
Request clarification before answering.
deleted
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
39 | |
8 | |
5 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.