That works on Fedora Rawhide if this is the expected output:

~~~

$ ruby -e "
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
"
yo
yo


$ rpm -q rubygem-{prawn,pdf-{core,inspector,reader}}
rubygem-prawn-2.2.2-4.fc32.noarch
rubygem-pdf-core-0.8.1-4.fc32.noarch
rubygem-pdf-inspector-1.3.0-5.fc32.noarch
rubygem-pdf-reader-2.1.0-5.fc32.noarch

~~~


Vít


Dne 06. 05. 20 v 11:44 Dan Allen napsal(a):
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 <dan.j.allen@gmail.com> 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 <vondruch@redhat.com> 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 -- ruby-sig@lists.fedoraproject.org
To unsubscribe send an email to ruby-sig-leave@lists.fedoraproject.org
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/ruby-sig@lists.fedoraproject.org
_______________________________________________
ruby-sig mailing list -- ruby-sig@lists.fedoraproject.org
To unsubscribe send an email to ruby-sig-leave@lists.fedoraproject.org
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/ruby-sig@lists.fedoraproject.org


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux

_______________________________________________
ruby-sig mailing list -- ruby-sig@lists.fedoraproject.org
To unsubscribe send an email to ruby-sig-leave@lists.fedoraproject.org
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/ruby-sig@lists.fedoraproject.org