Hi Mohammad,
Here's how our code was originally written, it's a Moose module btw,
with the $self->pdf() attribute holding the PDF::Create object.
The bit at the bottom with the image and closing the pdf was where the
problem was occurring.
As I say, the docs weren't too clear, and when I looked at the code, I
was half expecting close() to call flush(), or vice-verse, but I didn't
see that, so just reverted to 1.41 for now.
=head2 create_ticket
Creates PDF file with job ticket.
=cut
sub create_ticket {
my $self = shift;
$self->pdf( PDF::Create->new(
'filename' => $self->path,
'Author' => 'John Doe',
'Title' => 'Sample PDF',
'CreationDate' => [ localtime ],
) );
# add a Letter sized page
$self->page( $self->pdf->new_page('MediaBox' =>
$self->pdf->get_page_size('Letter')) );
# Prepare a font
$self->font_normal( $self->pdf->font('BaseFont' => 'Helvetica') );
$self->font_bold( $self->pdf->font('BaseFont' => 'Helvetica-Bold') );
$self->current_font($self->font_normal);
$self->page->string( $self->font_bold, 16,
421, 741, "#PrintIsGood");
$self->page->string( $self->font_bold, $self->font_size,
$self->line_begin, 681, "NOTICE OF ORDER:");
$self->page->string( $self->font_normal, $self->font_size,
$self->line_begin, 660, "Payment Details");
$self->x($self->line_begin);
$self->y(626.5);
$self->_println( "Order Number: " . $self->order->order_number );
$self->_println( "Payment Date: " . $self->payment_date );
$self->_println( "Buyer: " . $self->order->first_name . " " .
$self->order->last_name );
*
** my $jpg = $self->pdf->image($self->thumbnail);**
** $self->page->image( 'image' => $jpg, 'xscale' => 0.55, 'yscale' =>
0.55, 'xpos' => 320, 'ypos' => 550 );**
**
** # Close the file and write the PDF**
** $self->pdf->close;*
return $self->path;
}
On 20/09/17 10:19, Mohammad Sajid Anwar via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=123075 >
>
> Hi Rob,
>
> Apology for the inconvenience.
> Can you please provide script that can re-produce the issue you are having?
>
> It would help me investigate the matter quickly.
>
> Many Thanks.
> Best Regards,
> Mohammad S Anwar