Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-1173

Reduce file size of Invoice PDF documents

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Blesta uses TCPDF to render PDF documents. One problem with this is that in order to support the widest range of characters as possible, Blesta defaults to using the dejavusans font. Due to the architecture PDF, UTF-8 fonts must be embedded within the document, and this results in much larger sized documents.

      TCPDF has a feature (in version 6.0.072, possibly older), that allows embedding only characters in the document that are used within the document (part of TCPDF::SetFont(); $subset parameter). However, TCPDF is a monstrosity (24K lines of code, 870 KB+ single file) that may cause more problems than it solves.

      One of two things that can be done:

      1. Update TCPDF to take advantage of this feature.
      2. Switch to a different PDF rendering library. ZendPDF may be an option, though it doesn't look very good.

      One possible other option, though I'd hate to do this, is to patch our existing vendor copy of TCPDF to include the partial embed font feature.

        Activity

        cody Cody Phillips (Inactive) created issue -
        tyson Tyson Phillips (Inactive) made changes -
        Field Original Value New Value
        Assignee Cody Phillips [ cody ] Tyson Phillips [ tyson ]
        tyson Tyson Phillips (Inactive) made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Duplicate [ 3 ]

          People

          • Assignee:
            tyson Tyson Phillips (Inactive)
            Reporter:
            cody Cody Phillips (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: