2009 Jun 02 10:41 AM
I have a requirement wherein i need to find the filelength of the pdf/smartform i am calling, as i need to pass the length further .
Is there any function module to know the file length of pdf file?
Or any code to find it?
I am gettting my pdf. Now i only need to find the pdf_filelen
2009 Jun 02 10:49 AM
Hello Malvika,
Please explain your rwquirement in detail...
what you have, what exactly you want...
2009 Jun 02 10:52 AM
Use the Strlen() function
data: len type i.
len = strlen( filename ).
2009 Jun 02 10:53 AM
I have a perform as-
PERFORM record_otf_for_archiving TABLES otf pdf
USING pdf_filelen
l_toa_dara.
Now in my form, pdf_filelen is not being calculated.
I want to calculate the filelength of this pdf.
2009 Jun 02 10:55 AM
FM:- SCMS_XSTRING_TO_BINARY
or
DATA: HLTLINES TYPE I.
DATA: FLE1(2) TYPE P.
DATA: FLE2(2) TYPE P.
DATA: HFELD(500) TYPE C.
DATA: OFF1 TYPE P.
DATA: HTABIX LIKE SY-TABIX.
DESCRIBE TABLE PDF_OUTPUT LINES HLTLINES.
DESCRIBE FIELD PDF_OUTPUT LENGTH FLE1 IN BYTE MODE .
DESCRIBE FIELD T_OBJBIN LENGTH FLE2 IN BYTE MODE .
CLEAR T_OBJBIN.
REFRESH T_OBJBIN.
CLEAR OFF1.
CLEAR HFELD.
LOOP AT PDF_OUTPUT.
HTABIX = SY-TABIX.
MOVE PDF_OUTPUT TO HFELD+OFF1.
IF HTABIX = HLTLINES.
FLE1 = STRLEN( PDF_OUTPUT ).
ENDIF.
OFF1 = OFF1 + FLE1.
IF OFF1 GE FLE2.
CLEAR T_OBJBIN.
T_OBJBIN = HFELD(FLE2).
APPEND T_OBJBIN.
SHIFT HFELD BY FLE2 PLACES.
OFF1 = OFF1 - FLE2.
ENDIF.
IF HTABIX = HLTLINES.
IF OFF1 GT 0.
CLEAR T_OBJBIN.
T_OBJBIN = HFELD(OFF1).
APPEND T_OBJBIN.
ENDIF.
ENDIF.
ENDLOOP.
2009 Jun 03 10:05 AM
Hi,
Move the content of the PDF file to an internal table of line type CHAR255.
Then call the FM IWB_KXF_CALC_FILESIZE .
CALL FUNCTION 'IWB_KXF_CALC_FILESIZE'
IMPORTING
FILESIZE = <integer for file size>
FLINES = <integer for file no. of lines>
TABLES
kxffile = <internal table which hold the pdf data>.
Hope this will help you.
Regards,
Smart Varghese
2009 Jun 03 10:43 AM
Are you not using "CONVERT_OTF_2_PDF" to convert OTF to PDF ??
This FM will give the Filesize also..in field " bin_filesize "
Regards
Aj