Assuming you want to run it "online", this would work.
I made two changes to the code that was generated by Dev Studio:
1) I added a FILEDEF i.e. FILEDEF H_2 DISK baseapp/h_2.pdf
2) I changed the COMPOUND LAYOUT PCHOLD statement to COMPOUND LAYOUT HOLD AS H_2 FORMAT PDF
To explain:
COMPOUND LAYOUT HOLD tells WebFOCUS to create a server HOLD file, instead of rendering it in the browser.
But, since you want to create multiple PDF files, I give the HOLD file a name - H_2 in my example - this can obviously be an &variable.
It isn't really necessary to have different names if your program loops through values, since this is just going to be a "placeholder" to link to the FILEDEF.
FILEDEF then tells it where to save this file, and with what name.
So my example will create h_2.pdf in the BASEAPP directory.
FILEDEF H_2 DISK baseapp/h_2.pdf
-RUN
*-HOLD_SOURCE
-* File tj_test.fex
SET HTMLARCHIVE=ON
COMPOUND LAYOUT HOLD AS H_2 FORMAT PDF
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='prop_with_names^Margins_Left=0.5^Margins_Top=0.5^Margins_Right=0.5^Margins_Bottom=0.5^thumbnailscale=4', MERGE=OFF, ORIENTATION=PORTRAIT, PAGESIZE=Letter, SHOW_GLOBALFILTER=OFF, $
PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
OBJECT=STRING, NAME='text1', TEXT='<font face="TREBUCHET MS" size=10><FONT size=14 face="TREBUCHET MS ">Heading</FONT></font>', POSITION=(1.146 0.625), MARKUP=ON, WRAP=ON, DIMENSION=(6.458 0.312), METADATA='Z-INDEX: 1; POSITION: absolute; WIDTH: 6.458in; FONT-FAMILY: Trebuchet MS; WORD-WRAP: break-word; HEIGHT: 0.312in; FONT-SIZE: 10pt; TOP: 0.625in; LEFT: 1.146in', $
COMPONENT='report1', TEXT='report1', TOC-LEVEL=2, POSITION=(0.625 1.146), DIMENSION=(2.708 4.167), ARREPORTSIZE=DIMENSION, METADATA='Z-INDEX: 2; POSITION: absolute; WIDTH: 2.708in; HEIGHT: 4.167in; TOP: 1.146in; LEFT: 0.625in', $
END
SET COMPONENT='report1'
-*component_type report
TABLE FILE CENTURYSALES
SUM
CENTURYSALES.PRODSEG.PROFIT
BY LOWEST CENTURYSALES.ORDERS.STORECODE
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END
COMPOUND END
WebFOCUS 8.2.06 mostly Windows Server