- Albert John
- PowerBuilder
- Thursday, 25 November 2021 01:38 PM UTC
im trying to print image within powerbuilder, it printed the image,but it's NOT my expected,I expected print the image just fitted a A4 paper,i expected it has at least 90% of A4 but it actually printed picture just occupied like 1/2 or 1/3 of a A4 paper,not even 80%,the pic was really too small in a A4 paper
Please take a look at my code
I tried to dynamically create a datawindow which attached my pic
//ll_heights is the height of that pic
//ll_widths is the width of that pic
//ls_jpgsnames is the location of that pic
long ll_therow
string str_dwsyntax,str_lag
str_dwsyntax=dw_5.object.datawindow.syntax
for ll_i=1 to ll_jpgscounts
string ls_AddPict
dw_5.create(str_dwsyntax)
dw_5.settransobject(sqlca)
dw_5.reset()
dw_5.Modify("DataWindow.header.height='" + String(ll_heights[ll_i])+"' width='"+string(ll_widths[ll_i])+"'")
ls_AddPict ='CREATE bitmap(band=header x="1" y="1" height="'+string(ll_heights[ll_i])+ '"'+&
' width="' +string(ll_widths[ll_i])+'" filename="'+ ls_jpgsnames[ll_i]+'" name=logo "))'
dw_5.Modify(ls_AddPict)
dw_5.print()
ll_therow=dw_results.rowcount() - ll_jpgscounts +ll_i
wf_modifyresult(list_no_t,ls_prodno, ls_batchno,ll_jpgscounts,ls_jpgsnames[ll_i],"printed sucessful",ll_therow)
next
dw_5.create(str_dwsyntax)
dw_5.settransobject(sqlca)
dw_5.print()
btw all pics were scanned from A4 size papers
Any helps or any suggestions would be apperciated
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.