【问题标题】:How can I add an image at a specific X, Y location using Perl's PDF::API2?如何使用 Perl 的 PDF::API2 在特定 X、Y 位置添加图像?
【发布时间】:2009-08-07 11:25:55
【问题描述】:

我正在使用 Perl 的 PDF::API2 模块创建 PDF 文档,我需要在页面上的特定 X、Y 位置添加 PNG 图像。

我该怎么做?

【问题讨论】:

    标签: perl pdf


    【解决方案1】:

    其实我已经解决了:

    # grab a text object - we are missing fonts?
    my $gfx = $page->gfx;
    
    my $image = $self->pdf->image_png('/tmp/logo.png');
    
    # add the image to the graphic object - x, y, width, height  
    $gfx->image($image, 24, 815, 102, 29);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-10
      相关资源
      最近更新 更多