If you use a framework with inheritance like PFC you can change it easily. We made our system database configurable so you can change the PDF method.
Also, with build 1769 you no longer need to do the paper sizes.
Here is our code. placed in of_setpdfmethod PFC u_dw and then just one line code in the dw ancestor dw creator event.
string ls_method_cfg,ls_method_old,ls_method_new,ls_modify='',ls_rc
string ls_useprintspec,ls_imageformat
if not isvalid(this) then return 0
ls_method_cfg = gnv_sisu.of_getpdfmethod() //either hardcode or make configurable
ls_method_old = lower(this.Describe('DataWindow.Export.PDF.Method'))
if ls_method_old = '' then return 0 //dw object doesn't exists so exit
//no change
if ls_method_cfg = ls_method_old and ls_method_cfg <> 'nativepdf!' then
return no_action
end if
choose case ls_method_cfg
case 'nativepdf!'
ls_method_new = '2'
case 'distill!'
ls_method_new = '0'
case else
ls_method_new = '1'
end choose
//messagebox ("",ls_method_cfg+','+ls_method_old+','+ls_method_new)
if ls_method_cfg <> ls_method_old then
ls_modify = 'DataWindow.Export.PDF.Method='+ls_method_new
end if
//Change it to distill! or xslfop!
if ls_method_new = '0' or ls_method_new = '1' then
ls_rc = this.Modify(ls_modify)
// MessageBox('DataWindow Modify','Modify command: '+ls_modify+'~r~n~r~nResult: "'+ls_rc+'"')
return SUCCESS
end if
//Remaining code can only be used when PDF method is NativePDF.
//Always ensure images are in or are converted to JPG format (ImageFormat='1').
ls_imageformat = lower(this.describe('DataWindow.Export.PDF.NativePDF.ImageFormat'))
if ls_imageformat <> '1' then
ls_modify = lefttrim(ls_modify+' '+"DataWindow.Export.PDF.NativePDF.ImageFormat='1'")
end if
//Always use the paper size and print orientation from the DW Object's print specifications.
ls_useprintspec = lower(this.describe('DataWindow.Export.PDF.NativePDF.UsePrintSpec'))
if ls_useprintspec <> 'yes' then
ls_modify = lefttrim(ls_modify+' '+"DataWindow.Export.PDF.NativePDF.UsePrintSpec='yes'")
end if
if ls_modify > '' then
ls_rc = this.Modify(ls_modify)
end if
Return SUCCESS