//FFSubmenu=Drucken
//FFName=2 Bilder mit Bildnummer drucken
//**Start Encode**
// Die Abstände beziehen sich auf den bedruckbaren Bereich!
var hbor=20; // linker & rechter Rand in mm
var vbor=20; // oberer & unterer Rand in mm
var tsize=6; // Schrifthöhe in mm
var SS_CENTER = 1;
var lefttext=InputBox("Randtext","FixFoto","");
var xpix,ypix,xmm,ymm,thp,xo,yo,ih,parts,file;
var i,w,h,p,xscal,yscal,cnt = FF_GetImageCount();
if(cnt <= 0) FF_ErrorBreak("keine Bilder markiert!\n\n");
if(!FF_SelectPrinter()) FF_ErrorBreak("kein Drucker gewählt\n\n");
xpix = FF_GetPrintablePixelX();
ypix = FF_GetPrintablePixelY();
xmm = FF_GetPrintablemmX();
ymm = FF_GetPrintablemmY();
thp = tsize * ypix / ymm;
xo = hbor * xpix / xmm; xpix -= xo * 2 + thp * 2;
yo = vbor * ypix / ymm; ypix -= yo * 2;
ih = ypix / 2 - 2 * thp;
var fso = new ActiveXObject("Scripting.FileSystemObject");
for(i=0,p=0; i<cnt; i++)
{
FF_SetProgress(i,cnt);
file = FF_GetImagename(i);
if(!FF_LoadImage(file)) FF_ErrorBreak("Fehler beim Laden von: " + file);
xscal = xpix / FF_GetImageWidth();
yscal = ih / FF_GetImageHeight();
if(xscal < yscal)
{
w = FF_GetImageWidth() * xscal;
h = FF_GetImageHeight() * xscal;
}
else
{
w = FF_GetImageWidth() * yscal;
h = FF_GetImageHeight() * yscal;
}
if(0 == p)
{
FF_StartPrintPage();
FF_PrintImage(xo+thp*2+(xpix-w)/2,yo+thp,w,h);
FF_PrintText("Bild "+(i+1),xo+thp*2,yo,thp,0,400,0,0,"Arial",0);
}
else
{
FF_PrintImage(xo+thp*2+(xpix-w)/2,yo+thp+ypix/2,w,h);
FF_PrintText("Bild "+(i+1),xo+thp*2,yo+ypix/2,thp,0,400,0,0,"Arial",0);
}
p++;
if(2 == p)
{
FF_PrintText(lefttext,xo,ypix+yo,thp,2700,400,0,0,"Arial",0);
FF_LoadImage(FF_GetScriptPath()+"\\linie.jpg");
FF_PrintImage(xo+thp*3/2,yo,2,ypix);
FF_EndPrintPage();
p = 0;
}
}
if(0 != p)
{
FF_PrintText(lefttext,xo,ypix+yo,thp,2700,400,0,0,"Arial",0);
FF_LoadImage(FF_GetScriptPath()+"\\linie.jpg");
FF_PrintImage(xo+thp*3/2,yo,2,ypix);
FF_EndPrintPage();
}
function InputBox(title,window,preset)
{
var text;
FF_AddDialog(window,150,44);
FF_AddControl(window,title,"STATIC",4,2,142,12);
FF_SetControlStyle(window,title,SS_CENTER);
FF_AddControl(window,"text","SLEDIT",4,14,142,10);
FF_SetControl(window,"text",preset);
FF_AddControl(window,"OK","BUTTON",4,28,40,12);
FF_AddControl(window,"Abbrechen","BUTTON",106,28,40,12);
FF_ActivateControl(window,"text");
for(;;)
{
switch(FF_ShowDialog(window))
{
case "OK": text = FF_GetControl(window,"text");
if(text != "") {FF_CloseDialog(window); return text;}
break;
default: FF_CloseDialog(window); return "";
}
}
}