Here's a test script to prove it:

require 'prawn'
require 'pdf/reader'
require 'pdf/inspector'

Prawn::Document.generate 'test.pdf' do
  text 'yo'
end

puts ((PDF::Reader.new 'test.pdf').page 1).text

File.open 'test.pdf' do |fd|
  pdf = PDF::Inspector::Text.analyze fd
  puts pdf.strings
end

I ran it on this branch:
https://github.com/mojavelinux/prawn/tree/2.2.2-pdf-core-0.8.x

Best Regards,

-Dan

On Wed, May 6, 2020 at 3:33 AM Dan Allen <[email protected]> wrote:

> Vit,
>
> It seems to be due to this change:
> https://github.com/prawnpdf/pdf-core/commit/1b179c18359f1642f9294c8c23a8f1be51b48414
>
> This is making the font in the PDF (or at least the font metadata)
> corrupt. A PDF generated using Prawn 2.2.2 w/ pdf-core 0.8.1 cannot be read
> by PDF::Reader. It says there's a syntax error.
>
> Syntax Error (221557): Arg #0 to 'Tf' operator is wrong type (string)
> Syntax Error (221565): No font in show
>
> Best Regards,
>
> -Dan
>
> On Wed, May 6, 2020 at 2:53 AM Vít Ondruch <[email protected]> wrote:
>
>> Dan, thx for looking into this. Do you have more details? Is there some
>> patch we need to add on top of Prawn to fix this? I am asking because I am
>> not sure there is easy way do revert the pdf-core update (we can always
>> bump epoch, but this sucks for other reasons).
>>
>>
>> Vít
>>
>>
>> Dne 06. 05. 20 v 10:31 Dan Allen napsal(a):
>>
>> I've done some tests and what I've determined is that prawn 2.2.2 is
>> incompatible with pdf-core 0.8.1. These gems are extremely tightly coupled
>> because they're essentially one library. Thus, I think it's a mistake for
>> Fedora to be packaging pdf-core 0.8.1 at this time. It should either wait
>> for the next release of Prawn or package the prerelease from master (which
>> is tested against pdf-core 0.8.1).
>>
>> Best Regards,
>>
>> -Dan
>>
>> --
>> Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
>>
>> _______________________________________________
>> ruby-sig mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>> Fedora Code of Conduct: 
>> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
>> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
>> List Archives: 
>> https://lists.fedoraproject.org/archives/list/[email protected]
>>
>> _______________________________________________
>> ruby-sig mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>> Fedora Code of Conduct:
>> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
>> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
>> List Archives:
>> https://lists.fedoraproject.org/archives/list/[email protected]
>>
>
>
> --
> Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
>


-- 
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
_______________________________________________
ruby-sig mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]

Reply via email to