[SP-pm] Módulo PDF::API2 gerando pdf com erro.

Renato Santos renato.cron at gmail.com
Sat Oct 31 04:47:09 PDT 2015


Tenta usar o PDF::Haru.

Tem um post disso na SPPM
On Oct 31, 2015 06:09, "Lucas Moraes" <lucastiagodemoraes at gmail.com> wrote:

> Valeu Eduardo e Mantovani, encontrei o erro. E era no código abaixo:
>
> $pdf = PDF::API2->new();
> $old = PDF::API2->open('our/old.pdf');
> $page = $pdf->page();
> $gfx = $page->gfx();
>
> # Import Page 2 from the old PDF
> $xo = $pdf->importPageIntoForm($old, 2);
>
> # Add it to the new PDF's first page at 1/2 scale
> $gfx->formimage($xo, 0, 0, 0.5);
>
> $pdf->saveas('our/new.pdf');
>
> https://metacpan.org/pod/PDF::API2#PAGE-METHODS
>
> Esse código importava a pagina desejada, mas por algum motivo que eu não
> sei o mesmo gerava o arquivo new.pdf com erro.
> A solução foi usar CAM::PDF para importar a pagina e gerar o arquivo
> new.pdf.
>
> Valeu.
>
> Em 31 de outubro de 2015 00:30, Daniel de Oliveira Mantovani <
> daniel.oliveira.mantovani at gmail.com> escreveu:
>
>> Lucas, você estorou o cano e quer resolver o problema retirando a água
>> com um copo plástico. Você precisa investigar porque o PDF está "pesado",
>> eu leio livros inteiros em PDF e não acontece isso.
>>
>> On Friday, October 30, 2015, Eduardo Almeida <
>> eduardo at web2solutions.com.br> wrote:
>>
>>> Lucas, sem muito analisar, ta com cara de que o pdf ta mal formado :)
>>>
>>> Em 10/30/15 22:06, Lucas Moraes escreveu:
>>>
>>> Boa noite pessoal.
>>> Eu cortei várias partes de muitos PDF e estou juntando estas partes em
>>> apenas uma pagina de PDF.
>>> Estou conseguindo com exito, mas os arquivo gerado esta ficando muito
>>> grande e lento para abrir. Então eu fui usar Ghostscript para tentar
>>> diminuir, veja o erro que gera.
>>>
>>> lucas at lucas-moraes:~/Downloads$ gs -sDEVICE=pdfwrite
>>> -dCompatibilityLevel=1.4 -o out.pdf in.pdf
>>> GPL Ghostscript 9.10 (2013-08-30)
>>> Copyright (C) 2013 Artifex Software, Inc.  All rights reserved.
>>> This software comes with NO WARRANTY: see the file PUBLIC for details.
>>> Processing pages 1 through 1.
>>> Page 1
>>> Loading NimbusMonL-Bold font from
>>> /usr/share/fonts/type1/gsfonts/n022004l.pfb... 4469108 2736066 2176520
>>> 753832 3 done.
>>>    **** Error reading a content stream. The page may be incomplete.
>>>    **** Error reading a content stream. The page may be incomplete.
>>>    **** File did not complete the page properly and may be damaged.
>>>
>>>    **** This file had errors that were repaired or ignored.
>>>    **** The file was produced by:
>>>    **** >>>> PDF::API2 2.025 [linux] <<<<
>>>    **** Please notify the author of the software that produced this
>>>    **** file that it does not conform to Adobe's published PDF
>>>    **** specification.
>>>
>>> Alguém pode me ajudar ou indicar os possíveis problemas?
>>> Desde já eu agradeço.
>>> Bom final de semana a todos.
>>>
>>>
>>>
>>> =begin disclaimer
>>>    Sao Paulo Perl Mongers: http://sao-paulo.pm.org/
>>>  SaoPaulo-pm mailing list: SaoPaulo-pm at pm.org
>>>  L<http://mail.pm.org/mailman/listinfo/saopaulo-pm> <http://mail.pm.org/mailman/listinfo/saopaulo-pm>
>>> =end disclaimer
>>>
>>>
>>>
>>> --
>>> Eduardo Almeida - Software Engineer
>>> eduardo at web2solutions.com.br - 27.99831.8663
>>>
>>> *WEB2 Solutions* - Inovando, sempre!
>>>
>>
>>
>> --
>> Thank you very much!
>>
>> -dom
>>
>> --
>>
>> Daniel de Oliveira Mantovani
>> Business Analytic Specialist
>> Perl Evangelist /Astrophysics hobbyist.
>> +55 11 9 8538-9897
>> XOXO
>>
>>
>> =begin disclaimer
>>    Sao Paulo Perl Mongers: http://sao-paulo.pm.org/
>>  SaoPaulo-pm mailing list: SaoPaulo-pm at pm.org
>>  L<http://mail.pm.org/mailman/listinfo/saopaulo-pm>
>> =end disclaimer
>>
>>
>
> =begin disclaimer
>    Sao Paulo Perl Mongers: http://sao-paulo.pm.org/
>  SaoPaulo-pm mailing list: SaoPaulo-pm at pm.org
>  L<http://mail.pm.org/mailman/listinfo/saopaulo-pm>
> =end disclaimer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/saopaulo-pm/attachments/20151031/53f9935f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dhtmlx_certified.png
Type: image/png
Size: 11630 bytes
Desc: not available
URL: <http://mail.pm.org/pipermail/saopaulo-pm/attachments/20151031/53f9935f/attachment-0001.png>


More information about the SaoPaulo-pm mailing list