Lulu Developer Forums

API Applications

RSS Feed

Content PDF Generation using PHP - Error

    • Raja
    • Topic created 2 years ago

    Hi Ryan,

    When i tried to create Content PDF using PHP and upload to LULU via cURL, i got an error

    Here is my input Project JSON

    {"project_type":"hardcover","access":"private","bibliography":{"title":"Memoir Test Application","authors":[{"first_name":"Raja","last_name":"Ram"}],"category":2,"description":"This project is to test the application","language":"EN","country_code":"US"},"physical_attributes":{"binding_type":"jacket-hardcover","trim_size":"US_TRADE","paper_type":"regular","color":false},"pricing":[{"total_price":"16.08","product":"print","currency_code":"USD"}],"file_info":{"cover":[{"mimetype":"application\/pdf","filename":"new_cover.pdf"}],"contents":[{"mimetype":"application\/pdf","filename":"mypdffile.pdf"}]}}

    Array
    (
    [error_value] => The Times-Roman font is not embedded. (How do I embed fonts?)
    [error_type] => LApiPublishInvalidDocumentException
    )

    I have used DOMPDF for generating content PDF. I need to know how to generate the pdf automatically via PHP code that satisfies your requirements.'

    Thanks in Advance
    Raja.

    Message edited by Raja 2 years ago

  1. Ryan Bloom2 years ago

    I cannot tell you how to embed the fonts in a PDF with DOMPDF. I searched Google for this, and cannot easily determine if DOMPDF even supports this. The problem you are running into, is that fonts are annoying complex, and most computers don't have the same set of fonts. For that reason, we require that all PDFs have the fonts embedded so that we can ensure that book looks like the author intended. Tools like Adobe Acrobat and Illustrator will include the fonts.

    There is a script called "load_font.php", which might do what you want, but I looked at that code and can't be 100% certain. You might try asking on the DOMPDF mailing list for support embedding the font. As another bit of information on why embedding fonts is important, you can look at: "http://www.prepressure.com/pdf/basics/fonts"

    Ryan

  2. jahir2 years ago

    Hi Ryan,

    I had this error, while tring to publish the book in lulu. can you help me on this?, what's missing in my physical properties?

    this is my input json format.

    {"project_type":"hardcover","access":"private","bibliography":{"title":"Memoir Test Application","authors":[{"first_name":"jahir","last_name":"hussain"}],"category":2,"description":"This project is to test the application","language":"EN","country_code":"US"},"physical_attributes":{"binding_type":"jacket-hardcover","trim_size":"SIZE_12x12","paper_type":"regular","color":false},"pricing":[{"total_price":"16.08","product":"print","currency_code":null}],"file_info":{"cover":[{"mimetype":"application\/pdf","filename":"my_cover_1099487267.pdf"}],"contents":[{"mimetype":"application\/pdf","filename":"my_pdf_1099487267.pdf"}]}}

    Array
    (
    [error_value] => The provided combination of physical properties is not supported.
    [error_type] => LApiPublishInvalidPackageException
    )



    Thanks,

    Jagir

  3. Josiah Gore2 years ago

    We currently have limited support for books using the 12" x 12" trim size. Right now the only supported combination of attributes in that trim size are:

    12"x12" color interior casewrap-hardcover binding and premium paper type.

    The same is true for our 12.75" x 10.75" large landscape offering.

  4. Josiah Gore2 years ago

    While it is not exhaustive, there is a helpful chart of supported packages (along with corresponding supported page count ranges) near the bottom of this page:

    http://www.lulu.com/publish/books/

[ Page 1 of 1 ]