⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 07_outlines-pl

📁 PDF-API2-0.2.3.7_dev.tar.gz
💻
字号:
#!/usr/bin/perluse PDF::API2;$pdf=PDF::API2->new;$font=$pdf->corefont('Helvetica',1);$font->encode('latin1');$ot=$pdf->outlines;$oo=0;foreach $med ( 	[ 0, 0, 595, 842, 0, 0, "This Page is A4" ], 	[ 0, 0, 595, 842, 100, 0, "This Page is A4" ], 	[ 0, 0, 595, 842, 100, 1, "This Page is A4", "but copped !" ], 	[ 0, 0, 500, 800, 0, 0, "This Page is Custom" ], 	[ 0, 0, 500, 800, 100, 0, "This Page is Custom" ], 	[ 0, 0, 500, 800, 100, 1, "This Page is Custom", "but cropped !" ], 	[ 0, 0, 842, 1190, 0, 0, "This Page is A3" ], 	[ 0, 0, 842, 1190, 100, 0, "This Page is A3" ], 	[ 0, 0, 842, 1190, 100, 1, "This Page is A3", "but cropped !" ], 	[ 0, 0, 595, 842, 0, 0, "This Page is A4" ], 	[ 0, 0, 595, 842, 100, 0, "This Page is A4" ], 	[ 0, 0, 595, 842, 100, 1, "This Page is A4", "but copped !" ], 	[ 0, 0, 500, 800, 0, 0, "This Page is Custom" ], 	[ 0, 0, 500, 800, 100, 0, "This Page is Custom" ], 	[ 0, 0, 500, 800, 100, 1, "This Page is Custom", "but cropped !" ], 	[ 0, 0, 842, 1190, 0, 0, "This Page is A3" ], 	[ 0, 0, 842, 1190, 100, 0, "This Page is A3" ], 	[ 0, 0, 842, 1190, 100, 1, "This Page is A3", "but cropped !" ], 	[ 0, 0, 595, 842, 0, 0, "This Page is A4" ], 	[ 0, 0, 595, 842, 100, 0, "This Page is A4" ], 	[ 0, 0, 595, 842, 100, 1, "This Page is A4", "but copped !" ], 	[ 0, 0, 500, 800, 0, 0, "This Page is Custom" ], 	[ 0, 0, 500, 800, 100, 0, "This Page is Custom" ], 	[ 0, 0, 500, 800, 100, 1, "This Page is Custom", "but cropped !" ], 	[ 0, 0, 842, 1190, 0, 0, "This Page is A3" ], 	[ 0, 0, 842, 1190, 100, 0, "This Page is A3" ], 	[ 0, 0, 842, 1190, 100, 1, "This Page is A3", "but cropped !" ], ) {	($x,$y,$w,$h,$f,$c,@text)=@{$med};	$page = $pdf->page;	$page->mediabox($x-$f,$y-$f,$w+$f,$h+$f);	$page->cropbox($x,$y,$w,$h) if($c);	if($oo%3 == 0) {		$ot=$ot->outline;		$ot->title(join('',@text));		$ot->dest($page);	} else {		$ot->outline		   ->title(join('',@text))		   ->dest($page);	}	$oo++;		$ot=$pdf->outlines if($oo%11==0);		$gfx=$page->gfx;	$gfx->rect($x,$y,$w-$x,$h-$y);	$gfx->stroke;	$txt=$page->text;	$txt->font($font,20);	$txt->translate($x+10,$y+10);	$txt->text("L=($x,$y)");	$txt->translate($w-10,$h-20);	$txt->text_right("R=($w,$h)");	if($c) {		$txt->translate($x+10,$h-20);	} else {		$txt->translate($x-$f+10,$h+$f-20);	}	$txt->text(shift(@text)." F=($f)");	$txt->lead(20);	while(scalar @text > 0) {		$txt->cr;		$txt->text(shift @text);	}}$pdf->saveas("$0.pdf");$pdf->end();exit;__END__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -