Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous. You can also use this link to report any problems registering or logging in.

CTS 28 - PDF::Builder call from Web

  • 1 Replies
  • 12 Views
*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 667
    • View Profile
CTS 28 - PDF::Builder call from Web
« May 21, 2020, 09:17:39 AM »
 otrcomm commented

Hello All,
This is my first time at this forum.

I have a perl script that uses PDF::Builder that I can run from the terminal as root no problem, however when I try to call that same program via browser under apache2,
Code: [Select]
...
...
print FH "Inside select-signature.pl before PDF::Builder call\n" if $DEBUG > 0;
my $pdf = PDF::Builder->new(-compress => $compress);
print FH "Inside select-signature.pl after PDF::Builder call\n" if $DEBUG > 0;
...
...
I can not get pass the my $pdf = PDF::Builder->new(-compress => $compress); statement. The first print statement works, but the second one never fires.

Like I said, running as root from the command line, the script works as planned.

Any ideas?

Thanks in advance,
Murrah Boswell

 otrcomm commented

I figured it out! Operator error in some respects. However, in other respects, some free ttf fonts downloaded from web cause .../Builder/Resource/CIDFont/TrueType/FontFile.pm to raise errors at line 347.

 otrcomm commented

... removed those fonts and all works as planned.

 PhilterPaper commented

If there are certain fonts which cause PDF::Builder to blow up, it would be good for me to know about them. Either they are defective and users should be warned against using them, or something needs fixing in PDF::Builder. It would be helpful to know some of these fonts and how you tried to use them, and what problems you had. Be sure to check that you didn't somehow corrupt the fonts when you downloaded them! If you didn't, they should work in, say, a browser. What OS are you using? Thank you for the information.

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 667
    • View Profile
Re: CTS 28 - PDF::Builder call from Web
« Reply #1: May 21, 2020, 02:12:01 PM »
otrcomm commented

This turned out to be total operator error. The fonts that caused issues were chmoded 000 when I downloaded them so FontFile.pm could not read them. I just chmoded them to 644 and everything is okay. I guess when I was running as root from the terminal, FontFile.pm also ran as root and had not problems. However, since apache2 runs as www-data, it could not read them. But it is all ok now.

PhilterPaper commented

OK, I guess we all have "off" days. I'll close this.