Printing Avery 5160 labels with FPDF

北城余情 提交于 2019-12-03 08:27:28

I was using FPDF to make some custom labels for work recently. To get them to line up with the labels I was using, I had to disable Page Scaling in the Print dialog before printing. Don't know if it will solve your problem, but it's worth a shot.

this is what I needed to fix the scaling issues

Change $pdf->AddPage(); to $pdf->AddPage('P','Letter');

to force it to US Letter instead of A4

The dimensions for the labels are incorrect:

$left = 4.7625; // 0.1875" in mm
$top = 12.7; // 0.5" in mm
$width = 66.675; // 2.625" in mm
$height = 25.4; // 1.0" in mm
$hgap = 3.175; // 0.125" in mm
$vgap = 0.0;

also note printing from the browser the document will sometimes scale down use a PDF viewer and have it set to scale to actual size instead of scale to fit in the printer dialog.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!