Skip to Content
0
Former Member
Apr 30, 2015 at 10:44 AM

Converting OTF to PDF - Corrupt PDF Output

577 Views

Hi All,

I am splitting an OTF spool and sending each one to PDF. I have done this many times before, but this one just wont work! for every produced PDF I am getting adobe reader telling me that the file is "either not a supported type of because the file has been damaged".

I am splitting my OTF out to an itab based on ITCOO then i do the following:

APPEND closeOtf to itab.

ASSIGN buffer_pdf TO <buf>.

format = 'PDF'.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = format

IMPORTING

bin_filesize = dummy

TABLES

otf = itab

lines = <buf>

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

OTHERS = 4.

IF sy-subrc IS NOT INITIAL.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

PERFORM convert_otf2pdf_end(rstxcpdf)

TABLES <buf>

USING

otfcmd

numbytes

pdfcnv_archive_index

bin_file

pdf_username.

*Export the file to PDF

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = numbytes

FILENAME = p_full_export_path

FILETYPE = 'BIN'

TABLES

DATA_TAB = <buf>

EXCEPTIONS

FILE_WRITE_ERROR = 1.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = numbytes

FILENAME = p_full_export_backup_path

FILETYPE = 'BIN'

TABLES

DATA_TAB = <buf>

EXCEPTIONS

FILE_WRITE_ERROR = 1.

CLEAR p_export_name.

CLEAR itab.



This has worked for previous senarios I have worked on, but not this one which leaves me to wonder if my OTF is not in the correct format. Could you guys have a look at the following OTF to see if somethign in there is not right please. At no point do i see sy-subrc as anything other than 0.


Here is my test OTF:


// XPDF1 0700 00000+00000+1

IN 05P60

OP DINA4 P 144 240 1683811906000010000100001

IN 06MAIN

IN 06P60_HEADER

MT 0045400672

CP 41030000E

FC HELVE 120X 00100XSF007SF007410300067E

UL +0000000000000

SW 00067

CT 00000000

ST 0313356P60 End of Year Certificate

IN 06TAX_YEAR

CB 00000000

BX 0873100321018710022700000100

BX 0873100548009070028300000100

BX 1054500548000570028300000100

BX 0873100831018710005600000100

MT 0989200788

CP 41030000E

FC HELVE 090X 00075XSF007SF007410300050E

UL +0000000000000

SW 00050

CT 00000000

ST 00400082015

MT 0874400788

FC HELVE 120X 00100XSF007SF007410300067E

SW 00067

CT FFFFFF00

ST 0088118 5 April

MT 0915000489

FC HELVE 100 00084XSF005SF005410300056E

SW 00056

ST 0103422Tax Year to

IN 06EE_ADDR

MT 0153003358

CP 41030000E

FC HELVE 090X 00075XSF007SF007410300050E

UL +0000000000000

SW 00050

CT 00000000

ST 0137032 Mrs test test

MT 0153003598

ST 0150034 Address1

MT 0153003838

ST 0175042 Address2

MT 0153004078

ST 0183042 Address3 Address4

MT 0153004318

ST 0204046 County Postcode

CB 00000000

LI 0141703118V0161100015

LI 0619103118V0161100015

LI 0141003118H0478900015

LI 0141004729H0478900015

IN 06EE_DETAILS

CB FFFFFF00

BX 0771002993027550028600000100

CB BEBEBE00

BX 0771003279027550028100000100

CB FFFFFF00

BX 0771004127027550027700000100

CB BEBEBE00

BX 0771004404027550029000000100

CB FFFFFF00

BX 0771005261027550027300000100

CB BEBEBE00

BX 0771005534027550029400000100

MT 0771003161

CP 41030000E

FC HELVE 080 00067XSF005SF005410300044E

UL +0000000000000

SW 00044

CT 00000000

ST 0162744National Insurance No.

MT 0771004295

ST 0128034Works Payroll No.

MT 0771005429

ST 0186746Employer PAYE reference

MT 0782303519

FC HELVE 090X 00075XSF007SF007410300050E

SW 000509

ST 0104020 AA1234567A

MT 0782304644

ST 008001600000039

MT 0782305774

ST 0127034 581 / WI100

IN 06P60_END_OF_YEAR

CB BEBEBE00

BX 0052905159053220136100000100

MT 0052904987

CP 41030000E

FC HELVE 090 00075XSF005SF005410300050E

UL +0000000000000

SW 00050

CT 00000000

ST 0207050Employer's full name and

ST 0230056address (including postcode)

MT 0064205399

FC HELVE 090X 00075XSF007SF007410300050E

SW 00050

ST 0213042 Revenues and Customs

MT 0064205639

ST 0115024 RV Add1

MT 0064205879

ST 0063016 RV Add2

MT 0064206119

ST 0090018 RV Postcode

IN 06NATIONA_INSUR_CONTRIB

CB 00000000

BX 0052607200047910034000000100

BX 0531707200050970034000000100

CB FFFFFF00

BX 0052607597007370158700000100

BX 0126307597020410158700000100

BX 0330407597016550158700000100

BX 0495907597016780158700000100

BX 0663707597017690158700000100

BX 0840607597020070158700000100

CB BEBEBE00

BX 0052609184006240034000000100

BX 0137709184016720034000000100

BX 0349709184013440034000000100

BX 0511309184013040034000000100

BX 0675709184014680034000000100

BX 0856509184014970034000000100

BX 0052609524006240034000000100

BX 0137709524016720034000000100

BX 0349709524013440034000000100

BX 0511309524013040034000000100

BX 0675709524014680034000000100

BX 0856509524014970034000000100

BX 0052609864006240034000000100

BX 0137709864016720034000000100

BX 0349709864013440034000000100

BX 0511309864013040034000000100

BX 0675709864014680034000000100

BX 0856509864014970034000000100

BX 0052610204006240034000000100

BX 0137710204016720034000000100

BX 0349710204013440034000000100

BX 0511310204013040034000000100

BX 0675710204014680034000000100

BX 0856510204014970034000000100

BX 0171710861013380042000000100

BX 0433610861012470042000000100

BX 0688710861012130042000000100

BX 0930210861011110042000000100

MT 0531707368

CP 41030000E

FC HELVE 059 00050XSF005SF005410300033E

UL +0000000000000

SW 00033

CT FFFFFF00

ST 0155656(Note: LEL = Lower Earnings

ST 0147554Limit, UAP = Upper Accural

ST 0155656Point, UEL = Upper Earnings

ST 0028812Limit)

MT 0063907416

FC HELVE 100 00084XSF005SF005410300056E

SW 00056

ST 0172238National Insurance

ST 0181144Contributions in this

ST 0108920employment

MT 0811211449

FC HELVE 060 X00050XSF006SF006410300033E

SW 00033

CT 00000000

ST 0155658 Included in this employment

ST 0054218pay below

MT 0308911449

ST 0155658 Included in this employment

ST 0054218pay below

MT 0052611449

ST 0155658 Included in this employment

ST 0054218pay below

MT 0558311449

ST 0155658 Included in this employment

ST 0054218pay below

MT 0305511029

FC HELVE 060 00050XSF005SF005410300033E

SW 00033

ST 0097436Ordinary Statutory

MT 0305511197

ST 0116040Paternity Pay (OSPP)

MT 0810011029

ST 0098836Statutory Adoption

MT 0810011197

ST 0056018Pay (SAP)

MT 0558311029

ST 0104240Additional Statutory

MT 0558311197

ST 0114740Paternity Pay (ASPP)

MT 0052611029

ST 0100738Statutory Maternity

MT 0052611197

ST 0058018Pay (SMP)

MT 0829910784

FC HELVE 060X 00050XSF007SF007410300033E

SW 00033

ST 0102362

ST 0090650 £ P

MT 0586710784

ST 0102362

ST 0093952 £ P

MT 0361910784

ST 0099158 £

ST 0044324 P

MT 0119010784

ST 0079346 £

ST 0044324 P

MT 0849107741

FC HELVE 060 00050XSF005SF005410300033E

SW 00033

ST 0062220Employee's

MT 0849107885

ST 0068226contributions

MT 0849108029

ST 0101738due on all earnings

MT 0849108173

ST 0097534above the Primary

MT 0849108317

ST 0053518Threshold

MT 0913609037

FC HELVE 080 00067XSF005SF005410300044E

SW 00044

ST 0054820£ P

MT 0672207741

FC HELVE 060 00050XSF005SF005410300033E

SW 00033

ST 0083628Earnings above

MT 0672207885

ST 0078028the UAP, up to

MT 0672208029

ST 0071026and including

MT 0672208173

ST 0043414the UEL

MT 0672208605

ST 0086934(whole £'s only)

MT 0720409085

FC HELVE 080 00067XSF005SF005410300044E

SW 00044

ST 0008902£

MT 0504407741

FC HELVE 060 00050XSF005SF005410300033E

SW 00033

ST 0083628Earnings above

MT 0504407885

ST 0075230the PT, up to

MT 0504408029

ST 0071026and including

MT 0504408173

ST 0044714the UAP

MT 0504408605

ST 0035512(whole

FC HELVE 080 00067XSF005SF005410300044E

SW 00044

ST 0004402

FC HELVE 060 00050XSF005SF005410300033E

SW 00033

ST 0044818£'s only)

MT 0573209085

FC HELVE 080 00067XSF005SF005410300044E

SW 00044

ST 0013304 £

MT 0338907741

FC HELVE 060 00050XSF005SF005410300033E

SW 00033

ST 0083628Earnings above

MT 0338907885

ST 0074728the LEL, up to

MT 0338908029

ST 0071026and including

MT 0338908173

ST 0061422the Primary

MT 0338908317

ST 0080128Threshold (PT)

MT 0338908605

ST 0086934(whole £'s only)

MT 0387109085

FC HELVE 080 00067XSF005SF005410300044E

SW 00044

ST 0008902£

MT 0134807741

FC HELVE 060 00050XSF005SF005410300033E

SW 00033

ST 0080830Earnings at the

MT 0134807885

ST 0058218LEL(where

MT 0134808029

ST 0066924earnings are

MT 0134808173

ST 0056822equal to or

MT 0134808317

ST 0058820exceed the

MT 0134808461

ST 0025408LEL)

MT 0134808605

ST 0086934(whole £'s only)

MT 0223909133

FC HELVE 080 00067XSF005SF005410300044E

SW 00044

ST 0008902£

MT 0061107741

FC HELVE 060 00050XSF005SF005410300033E

SW 00033

ST 0020706NIC

MT 0061107885

ST 0026110table

MT 0061108029

ST 0026712letter

MT 0893909424

FC HELVE 090X 00075XSF007SF007410300050E

SW 00050

ST 00750181,145.75

MT 0744109424

ST 00100020

MT 0551509424

ST 005001011097

MT 0396909424

ST 00400082184

MT 0201309424

ST 00400085772

MT 0077309424

ST 0013002D

CB 00000000

LI 0126307597V0158700015

LI 0126307597V0158700015

LI 0330407597V0158700015

LI 0330407597V0158700015

LI 0495907597V0158700015

LI 0495907597V0158700015

LI 0663707597V0158700015

LI 0663707597V0158700015

LI 0840607597V0158700015

LI 0840607597V0158700015

IN 06PAY_INCOME_TAX_DETAILS

CB 00000000

BX 0045411943102050034000000100

CB FFFFFF00

BX 0164512850000570005700000100

CB BEBEBE00

BX 0170212907016440034000000100

BX 0345912907018710034000000100

CB FFFFFF00

BX 0548912907015930034000000100

CB BEBEBE00

BX 0759212907016440034000000100

BX 0171313361016440034000000100

BX 0347013361018710034000000100

BX 0171313786016440034000000100

BX 0347013786018710034000000100

BX 0171314211016440034000000100

CB FFFFFF00

BX 0440514211009350034000000100

MT 0056712159

CP 41030000E

FC HELVE 100 00084XSF005SF005410300056E

UL +0000000000000

SW 00056

CT FFFFFF00

ST 0246752Pay and Income Tax details

MT 0244212787

FC HELVE 080 00067XSF005SF005410300044E

SW 00044

CT 00000000

ST 0027606Pay

MT 0385212619

ST 0096924Tax deducted

MT 0379812787

ST 0107830(R= net refund)

MT 0764012619

ST 0184048Student Loan Deductions

MT 0812612787

FC HELVE 060 00050XSF005SF005410300033E

SW 00033

ST 0086934(whole £'s only)

MT 0045413075

FC HELVE 080 00067XSF005SF005410300044E

SW 00044

ST 0042614In this

MT 0045413243

ST 0087120employment

MT 0533013075

ST 0006202*

MT 0770513147

FC HELVE 090X 00075XSF007SF007410300050E

SW 00050

ST 0010004

MT 0357213147

ST 0125038 1,605.80

MT 0181513147

ST 0095024 17,948.47

MT 0182614451

CP 41030000E

UL +0000000000000

ST 0071020 991L

MT 0358314026

ST 0085022 1,605.80

MT 0182614026

ST 0090022 17,948.47

MT 0358313601

ST 0010004

MT 0182613601

ST 0010004

MT 0046613529

FC HELVE 080 00067XSF005SF005410300044E

SW 00044

ST 0078222In previous

MT 0046613697

ST 0105726employment(s)

MT 0046613954

ST 0094128Total for year

MT 0046614379

ST 0034810Final

MT 0046614547

ST 0060416tax code

CB 00000000

LI 0164512850V0005700015

LI 0164512850V0005700015

LI 0163812850H0006500015

LI 0170212850H0164400015

LI 0334612850H0011300015

LI 0345912850H0187100015

LI 0548912850V0005700015

LI 0533012850H0016700015

LI 0548912850V0005700015

LI 0164512907V0034000015

LI 0164512907V0034000015

LI 0548912907V0034000015

LI 0548912907V0034000015

LI 0164513247V0005700015

LI 0164513247V0005700015

LI 0163813304H0006500015

LI 0170213304H0164400015

LI 0334613304H0011300015

LI 0345913304H0187100015

LI 0548913247V0005700015

LI 0533013304H0016700015

LI 0548913247V0005700015

IN 06FIGURES

MT 0604813690

CP 41030000E

FC HELVE 065 00054XSF005SF005410300036E

UL +0000000000000

SW 00036

CT 00000000

ST 0177258Figures shown here should be

ST 0151258used for your tax return, if

ST 0067722you get one

MT 0558413690

FC HELVE 120X 00100XSF007SF007410300067E

SW 00067

ST 0009302*

CB 00000000

LI 0554413450V0036000015

LI 0571713450V0036000015

LI 0553713450H0018800015

LI 0553713810H0018800015

LI 0571713450V0036000015

LI 1033913450V0036000015

LI 0571013450H0463700015

LI 0571013810H0463700015

IN 06CERTIFICATE

MT 0545814171

CP 41030000E

FC HELVE 065 00054XSF005SF005410300036E

UL +0000000000000

SW 00036

CT 00000000

ST 0181062Certificate by Employer/Paying

ST 0037514Office:

MT 0545814339

SW 00038

ST 0180662This form shows your total pay

ST 0181862for Income Tax purposes in this

ST 0147750 employment for the year.

MT 0545814507

SW 00072

ST 0204762Any overtime, bonus, commission

ST 0159452 etc, Statutory Sick Pay,

ST 0145648Statutory Maternity Pay,

MT 0545814675

SW 00094

ST 0181058Ordinary Statutory Paternity

ST 0163152Pay, Additional Statutory

ST 0165252Paternity Pay or Statutory

MT 0545814843

SW 00036

ST 0145750Adoption Pay is included.

IN 06TO_THE_EMPLOYEE

MT 0049015187

CP 41030000E

FC HELVE 060X 00050XSF007SF007410300033E

UL +0000000000000

SW 00034

CT 00000000

ST 0094830To the employee

FC HELVE 060 00050XSF005SF005410300033E

SW 00034

ST 0153362. Please keep this certificate

ST 0084534in a safe place.

FC HELVE 060X 00050XSF007SF007410300033E

SW 00034

ST 0168262You will need it if you have to

ST 0158660 fill in a Tax Return, make a

ST 0147256claim for tax credits or to

ST 0108338renew your claim .

FC HELVE 060 00050XSF005SF005410300033E

SW 00034

ST 0101938You can also use it

MT 0049015355

SW 00044

ST 0169462to check that your employer is

ST 0145056deducting the right rate of

ST 0105838National Insurance

ST 0168162contributions for you and using

ST 0121946 your correct National

ST 0105736Insurance number.

FC HELVE 060X 00050XSF007SF007410300033E

SW 00044

ST 0177162By law you are required to tell

ST 0023106 HM

MT 0049015523

ST 0050114Revenue

FC HELVE 090 00075XSF005SF005410300050E

SW 00050

ST 0005002

FC HELVE 060X 00050XSF007SF007410300033E

SW 00033

ST 0193962& Customs about any income that

ST 0145758 is not fully taxed, even if

ST 0171960you are not sent a Tax Return.

MT 0049015859

FC HELVE 075X 00063XSF007SF007410300042E

SW 00042

ST 0194140HM REVENUE & CUSTOMS

CB 00000000

LI 0049015019H1015200015

IN 06SAP_UK

MT 0724015912

CP 41030000E

FC HELVE 075X 00063XSF007SF007410300042E

UL +0000000000000

SW 00042

CT 00000000

ST 0205054P60(Substitute)(SF)(SAP UK

ST 0099026LTD)(2013-14)

EP

//