Re: G::O::I based bindings and problem passing char array ref
- From: Jeremy Volkening <jdv base2bio com>
- To: Torsten Schoenfeld <kaffeetisch gmx de>
- Cc: gtk-perl-list gnome org
- Subject: Re: G::O::I based bindings and problem passing char array ref
- Date: Tue, 31 May 2016 13:07:58 -0500
Since new_from_data is currently not annotated to take an array of
bytes, a normal string should work fine in Perl. This works for me:
---
use Glib::Object::Introspection;
BEGIN {
Glib::Object::Introspection->setup (
basename => 'Poppler',
version => '0.18',
package => 'Poppler');
}
my $f = 'some PDF file';
open my $fh, '<:raw', $f or die "Could not open $f: $!";
my $data; { undef $/; $data = <$fh> };
close $fh;
warn my $d = Poppler::Document->new_from_data ($data, length $data);
---
Does it not work for you?
No - I get "PDF document is damaged at
/usr/lib/x86_64-linux-gnu/perl5/5.20/Glib/Object/Introspection.pm line 58."
What version of Poppler do you have?
Jeremy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]