I have a program that will take a txt file and create pdfs using
wIntegrate, using wIntegrate host subroutines and wIntegrate scripting.
I am having issues with the very first page though.
I can not get it to use the document settings for margins. If I create
a dummy page with file name or something then do a new page, the rest of
the report is correct. Dummy page looks like crap though.
Idea's?
Page setup routine:
**
SET.UP.PDF:
**
PDF.SCRIPT = ""
PDF.SCRIPT<-1> = 'PDF PaperSize Letter'
PDF.SCRIPT<-1> = 'PDF Orientation Portrait'
PDF.SCRIPT<-1> = 'PDF BeginDocument ':PDF.FNM:', ERR_VAL'
PDF.SCRIPT<-1> = 'PDF Font "Courier New", 8, FONT_Normal'
PDF.SCRIPT<-1> = 'PDF DocumentSettings ,,"0.5","0.5","0.5","0.5"'
PDF.SCRIPT<-1> = 'PDF ParagraphSettings ,,,,'
PDF.SCRIPT<-1> = 'PDF BeginParagraph'
PDF.SCRIPT<-1> = 'PDF Text "PDF created ':TIMEDATE():' from file
':TXT.FL.NM.LOC:'"'
PDF.SCRIPT<-1> = 'PDF EndParagraph'
PDF.SCRIPT<-1> = 'PDF NewPage'
File conversion routine:
CALL WIN.PCOPEN('TEXT.FILE',TXT.FL.NM.LOC, CONTINUE)
IF NOT(CONTINUE) THEN
SVR.STATUS = -1
SVR.MESSAGE = 'Can not open file to be converted.'
SVR.CTRL.NAME = 'errSystem'
SVR.CTRL.CODE = 1
RETURN
END
GOSUB SET.UP.PDF
RECORD = ""
FIRST = 1
PG.BRK.VAL = ''
EOF = 0
LOOP
CALL WIN.PCEOF('TEXT.FILE',EOF)
UNTIL EOF DO
CALL WIN.PCREADLN('TEXT.FILE',RECORD,"")
IF FIRST THEN
PG.BRK.VAL = RECORD<1>[1,5]
FIRST = 0
END ELSE
IF RECORD<1>[1,5] = PG.BRK.VAL THEN
PDF.SCRIPT<-1> = 'PDF NewPage'
PDF.SCRIPT<-1> = 'PDF ParagraphSettings ,,,,'
END
END
PDF.SCRIPT<-1> = 'PDF BeginParagraph'
PDF.SCRIPT<-1> = 'PDF Text ':DQUOTE(RECORD)
PDF.SCRIPT<-1> = 'PDF EndParagraph'
REPEAT
PDF.SCRIPT<-1> = 'PDF EndDocument'
CALL WIN.HSCRIPTC(PDF.SCRIPT)
CALL WIN.PCCLOSE("TEXT.FILE")
RETURN
Brenda L Price
UniVerse Programmer
Rapid Response Team
Market America, Inc.
Greensboro, NC
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users