Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7062879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:38:50+00:00 2026-05-28T04:38:50+00:00

I’m working on creating PDF files in PHP with the R&OS PDF class (

  • 0

I’m working on creating PDF files in PHP with the R&OS PDF class (http://www.ros.co.nz/pdf) trying to add some more fonts to the output. It requires a TTF file and an AFM file for the metrics, but I can’t get around the “bad /BBox” error as referred to in this post: Generating .afm from .ttf

At first I thought it was that I wasn’t using properly made ttf files, but I’ve tried converting some fonts that I know are legit (Arial) and I still get the error, so now I think it must be the AFM conversion.

The Stack post above refers to http://fpdf.fruit-lab.de/ as a good conversion tool- maybe I’m just using the wrong mapping? Is there a specific map format the PDF prefers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:38:50+00:00Added an answer on May 28, 2026 at 4:38 am

    I ran into the same problem using dompdf http://code.google.com/p/dompdf/ which uses R&OS PDF Class for rendering so this may help you.

    If you have a .ttf font skip to step 2.

    1. Upload your font to http://www.files-conversion.com/font-converter.php (Note: This website does have .afm as an option but the output file was 3mb vs 39kb from fruit-lab) select .ttf and save it.
    2. Upload your .ttf to http://fpdf.fruit-lab.de/ and download the .afm file.
    3. Copy both the .ttf and .afm file to your font directory and make sure they are exactly the same name and case!

    I had problems with spaces so I used CamelCase and my .ttf extension was uppercase and my .afm extension was lower case. Once I made sure I had the .afm and .ttf named in CamelCase with no spaces and lower case extensions it worked!

    This is probably dompdf specific, I then had to update dompdf_font_family_cache.dist.php and include my font in the array like so:

    'testscript' => array (
        'normal' => DOMPDF_FONT_DIR . 'TestScript',
        'bold' => DOMPDF_FONT_DIR . 'TestScript',
        'italic' => DOMPDF_FONT_DIR . 'TestScript',
        'bold_italic' => DOMPDF_FONT_DIR . 'TestScript',
    )
    

    Note: I only wanted one version of the font – not bold, italic etc so I just made them all point to the same font file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.