سلام
من قصد دارم که بر روی فرم های نیمه آماده یا به تعبیری از پیش چاپ شده مشخصات وام گیرنده تاریخ سر رسید مبلغ قسط و غیره رو چاپ کنم. با استفاده از تابعی در جاوا اسکریپت مشخصات رو از فرمی در صفحه وب می گیره و با ایجاد چهار جدول در جاوا اسکریپت و تعیین میزان عرض و ارتفاع و حاشیه چهار تا جدول می سازه که البته میزان border رو صفر تعیین کردم چون خودش border داره و باید در این برنامه برای هر برگه وام از این دفترچه شماره سریال رو یک واحد افزایش بده اندازه بگه با اندازه گیری که من کردم b5 هست در هر برگه b5 چهار برگه از دفترچه اقساط هست.اسکن برگه b5 رو با dpi 100 در برنامه mspaint در ویندوز باز کردم میزان طول و عرض هر جدول رو با پیکسل اندازه گرفتم ارتفاع هر جدول و عرض هر سلول و هر چی که لازم بود فاصله بین هر جدول و غیره. وقتی وارد برنامه جاوا اسکریپت کردم و در گوگل کروم مشخصات رو وارد کردم و پرینت گرفتم دقیق در نمیاد و همیشه یک جای کار عیب پیدا می کنه یا مشخصات در جای دقیقش چاپ نمیشه یا اگه در یک فرم دقیق چاپ بشه برگه بعدی دفترچه یا جودل بعدی دقیق در نمی یاد .

کسی هست راهکار دقیق تر و بهتری ارائه بده .یا بگه چطوری برنامه رو اصلاح کنم.aghsat100dpi-b5-mm.jpg



var oTable= document.createElement("table");
oTable.setAttribute("border","1");
//oTable.setAttribute("background","background2.jpg" );
var oTbody= document.createElement("tbody");
oTable.appendChild(oTbody);
oTable.style.textAlign="center";
oTable.style.position="absolute";
oTable.style.left="0px";//(screen.availWidth/2-298).toString()+"px";

oTable.style.top=((i % 4)*353 +((i % 4))*60).toString()+"px";

/*
if((i%4)==0){
oTable.style.top=(0).toString()+"px";
}else if((i%4)==1){
oTable.style.top=(353+60).toString()+"px";
}else if((i%4)==2){
oTable.style.top=((2*353)+(2*60)).toString()+"px";
}else if((i%4)==3){
oTable.style.top=((3*353)+(3*60)).toString()+"px";
}
*/
//oTable.style.top=((i % 4)*1 +((i % 4)+1)*(1.1)).toString()+"mm";
oTable.style.height="353px";
oTable.style.width="922px";
oTable.style.position="absolute";
oTable.style.borderCollapse="collapse";
oTable.style.fontSize= olist.options[olist.selectedIndex].value;//"17px";
oTable.style.fontWeight="bold";

oTbody.insertRow(0);
oTbody.rows[0].insertCell(0);
oTbody.rows[0].cells[0].appendChild(document.createTextNode(ToFarsiDigit( (serial+i).toString())));

oTbody.rows[0].insertCell(1);
oTbody.rows[0].cells[1].appendChild(document.createTextNode(""));//"سریال"));

oTbody.rows[0].insertCell(2);
oTbody.rows[0].cells[2].setAttribute("colspan","4");
oTbody.rows[0].cells[2].appendChild(document.createTextNode(gharzolhasane _name));

//********************************NEW ROW***************

oTbody.insertRow(1);
oTbody.rows[1].insertCell(0);
oTbody.rows[1].cells[0].appendChild(document.createTextNode(ToFarsiDigit( shomare_wam.toString())));

oTbody.rows[1].insertCell(1);
oTbody.rows[1].cells[1].appendChild(document.createTextNode(""));//شماره وام"));

oTbody.rows[1].insertCell(2);
oTbody.rows[1].cells[2].appendChild(document.createTextNode(ToFarsiDigit( (serial+i).toString() )));

oTbody.rows[1].insertCell(3);
oTbody.rows[1].cells[3].appendChild(document.createTextNode(""));//"شماره سریال"));

oTbody.rows[1].insertCell(4);
oTbody.rows[1].cells[4].appendChild(document.createTextNode(ToFarsiDigit( shomare_wam.toString())));

oTbody.rows[1].insertCell(5);
oTbody.rows[1].cells[5].appendChild(document.createTextNode(""));//"شماره وام"));

oTbody.rows[1].cells[2].style.width="135px";
oTbody.rows[1].cells[3].style.width="159px";
oTbody.rows[1].cells[4].style.width="194px";
oTbody.rows[1].cells[5].style.width="130px";

//********************************NEW ROW***************
oTbody.insertRow(2);
oTbody.rows[2].insertCell(0);
oTbody.rows[2].cells[0].appendChild(document.createTextNode(Atarikh_farsi[i].substring(0,4)+"/"+Atarikh_farsi[i].substring(4,6)+"/"+Atarikh_farsi[i].substring(6,8)));

oTbody.rows[2].insertCell(1);
oTbody.rows[2].cells[1].appendChild(document.createTextNode(""));//"سررسید"));

oTbody.rows[2].insertCell(2);
oTbody.rows[2].cells[2].setAttribute("colspan","3");
oTbody.rows[2].cells[2].appendChild(document.createTextNode(vamgirande_na me));

oTbody.rows[2].insertCell(3);
oTbody.rows[2].cells[3].appendChild(document.createTextNode(""));//"وام گیرنده"));



//********************************NEW ROW***************
oTbody.insertRow(3);
oTbody.rows[3].insertCell(0);
oTbody.rows[3].cells[0].appendChild(document.createTextNode(ToFarsiDigit( (i+1).toString())));

oTbody.rows[3].insertCell(1);
oTbody.rows[3].cells[1].appendChild(document.createTextNode(""));//"شماره قسط"));

oTbody.rows[3].insertCell(2);
oTbody.rows[3].cells[2].appendChild(document.createTextNode(ToFarsiDigit( (i+1).toString())));

oTbody.rows[3].insertCell(3);
oTbody.rows[3].cells[3].appendChild(document.createTextNode(""));//"شماره قسط"));

oTbody.rows[3].insertCell(4);
oTbody.rows[3].cells[4].appendChild(document.createTextNode(seperate3( ToFarsiDigit(mablagh_har_ghest.toString() ))));

oTbody.rows[3].insertCell(5);
oTbody.rows[3].cells[5].appendChild(document.createTextNode(""));//"مبلغ قسط"));


oTbody.rows[3].cells[2].style.width="135px";
oTbody.rows[3].cells[3].style.width="159px";
oTbody.rows[3].cells[4].style.width="194px";
oTbody.rows[3].cells[5].style.width="130px";

//********************************NEW ROW***************
oTbody.insertRow(4);
oTbody.rows[4].insertCell(0);
oTbody.rows[4].cells[0].appendChild(document.createTextNode(seperate3( ToFarsiDigit(mablagh_har_ghest.toString()))));

oTbody.rows[4].insertCell(1);
oTbody.rows[4].cells[1].appendChild(document.createTextNode(""));//"مبلغ قسط"));

oTbody.rows[4].insertCell(2);
oTbody.rows[4].cells[2].appendChild(document.createTextNode(Atarikh_farsi[i].substring(0,4)+"/"+Atarikh_farsi[i].substring(4,6)+"/"+Atarikh_farsi[i].substring(6,8)));

oTbody.rows[4].insertCell(3);
oTbody.rows[4].cells[3].appendChild(document.createTextNode(""));//"تاریح سررسید"));

oTbody.rows[4].insertCell(4);
oTbody.rows[4].cells[4].appendChild(document.createTextNode(seperate3( ToFarsiDigit((asle_wam- mablagh_har_ghest*i).toString() ))));

oTbody.rows[4].insertCell(5);
oTbody.rows[4].cells[5].appendChild(document.createTextNode(""));//"مانده فعلی"));



oTbody.rows[4].cells[2].style.width="135px";
oTbody.rows[4].cells[3].style.width="159px";
oTbody.rows[4].cells[4].style.width="194px";
oTbody.rows[4].cells[5].style.width="130px";


//********************************NEW ROW***************
oTbody.insertRow(5);
oTbody.rows[5].insertCell(0);
oTbody.rows[5].cells[0].appendChild(document.createTextNode(""));

oTbody.rows[5].insertCell(1);
oTbody.rows[5].cells[1].appendChild(document.createTextNode(""));//"تاریخ"));

oTbody.rows[5].insertCell(2);
oTbody.rows[5].cells[2].setAttribute("colspan","3");
oTbody.rows[5].cells[2].appendChild(document.createTextNode(mablagh_horou fi));

oTbody.rows[5].insertCell(3);
oTbody.rows[5].cells[3].appendChild(document.createTextNode(""));//"مبلغ بحروف"));



//********************************NEW ROW***************
oTbody.insertRow(6);
oTbody.rows[6].insertCell(0);
oTbody.rows[6].cells[0].appendChild(document.createTextNode(""));

oTbody.rows[6].insertCell(1);
oTbody.rows[6].cells[1].appendChild(document.createTextNode(""));//"مهر و امضا"));

oTbody.rows[6].insertCell(2);
oTbody.rows[6].cells[2].setAttribute("colspan","2");
oTbody.rows[6].cells[2].appendChild(document.createTextNode(""));//"مهر و امضا تحویلدار"));

oTbody.rows[6].insertCell(3);
oTbody.rows[6].cells[3].setAttribute("colspan","2");
oTbody.rows[6].cells[3].appendChild(document.createTextNode(""));//"تاریخ دریافت"));


//oTbody.insertRow(7);
//********************************NEW ROW***************
oTbody.rows[0].style.height="50px";
oTbody.rows[1].style.height="50px";
oTbody.rows[2].style.height="50px";
oTbody.rows[3].style.height="50px";
oTbody.rows[4].style.height="50px";
oTbody.rows[5].style.height="50px";
oTbody.rows[6].style.height="50px";
// oTbody.rows[7].style.height="19px";

oTbody.rows[0].cells[0].style.width="203px";
oTbody.rows[1].cells[0].style.width="203px";
oTbody.rows[2].cells[0].style.width="203px";
oTbody.rows[3].cells[0].style.width="203px";
oTbody.rows[4].cells[0].style.width="203px";
oTbody.rows[5].cells[0].style.width="203px";
oTbody.rows[6].cells[0].style.width="203px";


oTbody.rows[0].cells[1].style.width="101px";
oTbody.rows[1].cells[1].style.width="101px";
oTbody.rows[2].cells[1].style.width="101px";
oTbody.rows[3].cells[1].style.width="101px";
oTbody.rows[4].cells[1].style.width="101px";
oTbody.rows[5].cells[1].style.width="101px";
oTbody.rows[6].cells[1].style.width="101px";


document.body.appendChild(oTable);