for reference purposes I wanted to add this sample program to this thread. In case someone else wants to make a PDF on top of a PDF background
I attached the PDR files - of course their path would need to be modified, but otherwise this should function in any
Code: Select all
20140 dim pdfOutFile$*1024
20180 pdfOutFile$='test.pdf'
20200 Open #hPdfOut:=1: 'Name=PDF:,PrintFile='&pdfOutFile$&',Replace,RecL=5000',Display,Output
25020 print #hPdfOut: newpage
25040 fn_w2('R:\Core\pdf\W-2 copy 1.pdf')
25060 print #hPdfOut: newpage
25080 fn_w2('R:\Core\pdf\W-2 copy 2.pdf')
38000 close #hPdfOut:
38020 exe 'sy -C "'&os_filename$(pdfOutFile$)&'"'
38040 fnxit
50000 def fn_w2(background_pdf$*256)
50020 if ~w2_setup then
50040 w2_setup=1
50050 dim xLine(12)
50060 yCol(1)=230
50080 yCol(2)=3200
50100 yCol(3)=4420
50120 xLine(1)=xLineTemp=225 : xLineHeight=240
50140 for xLineItem=2 to 10
50160 xLine(xLineItem)=xLineTemp+=xLineHeight
50180 nex xLineItem
50200 y2Col(1)=230
50220 y2Col(2)=500
50240 y2Col(3)=1800
50260 y2Col(4)=2650
50280 y2Col(5)=3450
50300 y2Col(6)=4300
50320 y2Col(7)=5100
50340 xLine(11)=xLineTemp+=(xLineHeight+100)
50360 xLine(12)=xLineTemp+=xLineHeight
50380 end if
52000 print #hPdfOut: chr$(27)&"pdf='1,"&background_pdf$&"'";
52020 ! print #hPdfOut: chr$(27)&"&a0v0H"; ! top left
52040 ! print #hPdfOut: chr$(27)&"position='2,10'";
52060 fn_pr(xLine(1),1350,'Box A: SSN')
52080 fn_pr(xLine(2),yCol(1),'Box B')
52100 fn_pr(xLine(3)+000,yCol(1),'Box C - Line 1')
52120 fn_pr(xLine(3)+110,yCol(1),'Box C - Line 2')
52140 fn_pr(xLine(3)+220,yCol(1),'Box C - Line 3')
52160 fn_pr(xLine(3)+330,yCol(1),'Box C - Line 4')
52180 fn_pr(xLine(3)+440,yCol(1),'Box C - Line 5')
52200 fn_pr(xLine(2),yCol(2),'Box 1')
52220 fn_pr(xLine(2),yCol(3),'Box 2')
52240 fn_pr(xLine(3),yCol(2),'Box 3')
52260 fn_pr(xLine(4),yCol(2),'Box 5')
52280 fn_pr(xLine(4),yCol(3),'Box 6')
52300 fn_pr(xLine(5),yCol(2),'Box 7')
52320 fn_pr(xLine(5),yCol(3),'Box 8')
52340 fn_pr(xLine(6),yCol(1),'Box D Control Number')
52360 fn_pr(xLine(6),yCol(2),'Box 9')
52380 fn_pr(xLine(6),yCol(3),'Box 10')
52400 fn_pr(xLine(7),yCol(1),'Box E')
52420 fn_pr(xLine(7),1550,'last name')
52440 fn_pr(xLine(7),2950,'Suff')
52460 fn_pr(xLine(7),yCol(2),'Box 11')
52480 fn_pr(xLine(7),yCol(3),'Box 12a')
52500 fn_pr(xLine(8),yCol(2)+120,'1')
52520 fn_pr(xLine(8),yCol(2)+470,'2')
52540 fn_pr(xLine(8),yCol(2)+780,'3')
52560 fn_pr(xLine(8),yCol(3),'Box 12b')
52580 fn_pr(xLine(9),yCol(3),'Box 12c')
52600 fn_pr(xLine(10),yCol(3),'Box 12d')
52620 fn_pr(xLine(8)+000,yCol(1),'Box F - Line 1')
52640 fn_pr(xLine(8)+110,yCol(1),'Box F - Line 2')
52660 fn_pr(xLine(8)+220,yCol(1),'Box F - Line 3')
52680 fn_pr(xLine(8)+330,yCol(1),'Box F - Line 4')
52700 fn_pr(xLine(8)+440,yCol(1),'Box F - Line 5')
54000 fn_pr(xLine(11),y2Col(1),'ST1')
54020 fn_pr(xLine(12),y2Col(1),'ST2')
54040 fn_pr(xLine(11),y2Col(2),'Emp State ID 1')
54060 fn_pr(xLine(12),y2Col(2),'Emp State ID 2')
54080 fn_pr(xLine(11),y2Col(3),'Col 3')
54100 fn_pr(xLine(12),y2Col(3),'Col 3')
54120 fn_pr(xLine(11),y2Col(4),'Col 4')
54140 fn_pr(xLine(12),y2Col(4),'Col 4')
54160 fn_pr(xLine(11),y2Col(5),'Col 5')
54180 fn_pr(xLine(12),y2Col(5),'Col 5')
54200 fn_pr(xLine(11),y2Col(6),'Col 6')
54220 fn_pr(xLine(12),y2Col(6),'Col 6')
54240 fn_pr(xLine(11),y2Col(7),'Col 7')
54260 fn_pr(xLine(12),y2Col(7),'Col 7')
58000 fnend
64000 def fn_pr(deciposX,deciposY,text$*256) ! x=up/down, y=left/right
64020 print #hPdfOut: chr$(27)&'&a'&str$(deciposX)&'v'&str$(deciposY)&'H';
64040 print #hPdfOut: text$;
64060 fnend