Coder Social home page Coder Social logo

tc-lib-pdf's Introduction

tc-lib-pdf

PHP PDF Library

UNDER DEVELOPMENT (NOT READY)

UPDATE: CURRENTLY ALL THE DEPENDENCY LIBRARIES COMPLETE. THE CORE LIBRARY CONTAINS PRIMITIVE METHODS TO GENERATE A PDF DOC. MISSING: advanced text methods, html and css parsing.

Latest Stable Version Build Coverage License Downloads

Donate via PayPal Please consider supporting this project by making a donation via PayPal

Description

PHP library for generating PDF documents on-the-fly.

Main Features:

  • no external libraries are required for the basic functions;
  • all standard page formats, custom page formats, custom margins and units of measure;
  • UTF-8 Unicode and Right-To-Left languages;
  • TrueTypeUnicode, OpenTypeUnicode v1, TrueType, OpenType v1, Type1 and CID-0 fonts;
  • font subsetting;
  • methods to publish some XHTML + CSS code, Javascript and Forms;
  • images, graphic (geometric figures) and transformation methods;
  • supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/script/formats.php)
  • 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extension, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417;
  • JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Pdfs and Transparencies;
  • automatic page header and footer management;
  • document encryption up to 256 bit and digital signature certifications;
  • transactions to UNDO commands;
  • PDF annotations, including links, text and file attachments;
  • text rendering modes (fill, stroke and clipping);
  • multiple columns mode;
  • no-write page regions;
  • bookmarks, named destinations and table of content;
  • text hyphenation;
  • text stretching and spacing (tracking);
  • automatic page break, line break and text alignments including justification;
  • automatic page numbering and page groups;
  • move and delete pages;
  • page compression (requires php-zlib extension);
  • XOBject Templates;
  • Layers and object visibility.
  • PDF/A-1b support.

Third party fonts:

This library may include third party font files released with different licenses.

All the PHP files on the fonts directory are subject to the general TCPDF license (GNU-LGPLv3), they do not contain any binary data but just a description of the general properties of a particular font. These files can be also generated on the fly using the font utilities and TCPDF methods.

All the original binary TTF font files have been renamed for compatibility with TCPDF and compressed using the gzcompress PHP function that uses the ZLIB data format (.z files).

The binary files (.z) that begins with the prefix "free" have been extracted from the GNU FreeFont collection (GNU-GPLv3). The binary files (.z) that begins with the prefix "pdfa" have been derived from the GNU FreeFont, so they are subject to the same license. For the details of Copyright, License and other information, please check the files inside the directory fonts/freefont-20120503 Link : http://www.gnu.org/software/freefont/

The binary files (.z) that begins with the prefix "dejavu" have been extracted from the DejaVu fonts 2.33 (Bitstream) collection. For the details of Copyright, License and other information, please check the files inside the directory fonts/dejavu-fonts-ttf-2.33 Link : http://dejavu-fonts.org

The binary files (.z) that begins with the prefix "ae" have been extracted from the Arabeyes.org collection (GNU-GPLv2). Link : http://projects.arabeyes.org/

ICC profile:

TCPDF includes the sRGB.icc profile from the icc-profiles-free Debian package: https://packages.debian.org/source/stable/icc-profiles-free

Getting started

First, you need to install all development dependencies using Composer:

$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer

You can install the library via composer:

composer require tecnickcom/tc-lib-pdf

This project include a Makefile that allows you to test and build the project with simple commands. To see all available options:

make help

To install all the development dependencies:

make deps

Running all tests

Before committing the code, please check if it passes all tests using

make qa

All artifacts are generated in the target directory.

Example

Examples are located in the example directory.

Start a development server (requires PHP 8.0+) using the command:

make server

and point your browser to http://localhost:8971/index.php

Installation

Create a composer.json in your projects root-directory:

{
    "require": {
        "tecnickcom/tc-lib-pdf": "dev-main"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "[email protected]:tecnickcom/tc-lib-pdf.git"
        }
    ]
}

Packaging

This library is mainly intended to be used and included in other PHP projects using Composer. However, since some production environments dictates the installation of any application as RPM or DEB packages, this library includes make targets for building these packages (make rpm and make deb). The packages are generated under the target directory.

When this library is installed using an RPM or DEB package, you can use it your code by including the autoloader:

require_once ('/usr/share/php/Com/Tecnick/Barcode/autoload.php');

Developer(s) Contact

tc-lib-pdf's People

Contributors

macjohnny avatar maehdros avatar nicolaasuni avatar valiodotch avatar watheqalshowaiter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tc-lib-pdf's Issues

Planned stable release date? PHP 7 support?

Hi,

Is there a release date for this new library? 2017? 2018?

Does it support PHP 7?
The old lib (but currently active one) seems not to support it?

Will it have a completly new API or could one simply migrate from the old lib to the new one?

It seems to be a great project - thank you!

QR Code barcodes

If you plan to copy over the barcode code from TCPDF, I'd like to point out that the QRCODE generation seems to choose a different 'best' solution on each request instead of the 'best' method which means you get a different image on each request.

I like to help with this library

Hi there,

Can you define interface that library will be defined?
Thanks to interface, we can fill it with implementation and go on with development of this great library.

Do you have plan for creating PDF content?

Best regards,
Maciek

How to get started?

Hi there! 👋

I just wanted to give this a spin for the first time, but after installing it via composer, it's just kind of empty. This is the Tcpdf-class, for example (./vendor/tecnickcom/tc-lib-pdf/src/Tcpdf.php):

<?php
/**
 * Tcpdf.php
 *
 * @since       2002-08-03
 * @category    Library
 * @package     Pdf
 * @author      Nicola Asuni <[email protected]>
 * @copyright   2002-2016 Nicola Asuni - Tecnick.com LTD
 * @license     http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
 * @link        https://github.com/tecnickcom/tc-lib-pdf
 *
 * This file is part of tc-lib-pdf software library.
 */

namespace Com\Tecnick\Pdf;

use \Com\Tecnick\Pdf\Exception as PdfException;

/**
 * Com\Tecnick\Pdf\Tcpdf
 *
 * Tcpdf PDF class
 *
 * @since       2002-08-03
 * @category    Library
 * @package     Pdf
 * @author      Nicola Asuni <[email protected]>
 * @copyright   2002-2016 Nicola Asuni - Tecnick.com LTD
 * @license     http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
 * @link        https://github.com/tecnickcom/tc-lib-pdf
 */
class Tcpdf
{
    /**
     * Information string
     *
     * @var string
     */
    protected $info = '';

    /**
     * Initialize
     *
     * @TODO
     */
    public function __construct()
    {
        $this->info = 'THIS PROJECT IS UNDER CONSTRUCTION';
    }
    
    /**
     * Example method
     *
     * @TODO
     */
    public function getInfo()
    {
        return $this->info;
    }
}

Any idea what I am doing wrong?

Emoji in text

I'm generating PDF files on the fly with user content which could contain emoji-characters.
Currently I'm using a custom font and emoji-characters don't get displayed in the PDF (some are totally hidden, some are printed in unknown characters).

To be honest, I don't know exactly where to start looking. Should my custom font include the emoji-characters? Or can I do something else to include them?
I've tried both MultiCell and writeHTMLCell.

Thanks!

Images in the pdf results have some kind of transparency, instead of rendering fully opaque

Hello! Thanks for your work on this package.

I have an issue where the images seem to have some transparency instead of rendering full color,

Please see page 2 of this pdf,
http://customizer.prolook.com/design_sheets/A6D6B362-32E6-5154-93EB-59FC24258811.pdf

Also theres a small thumbnail of a mascot on page 5, the appear to have some king of transparency setting.

The full color of the image which is also the same as the source image being used by the pdf is at
https://s3-us-west-2.amazonaws.com/uniformbuilder/uploads/staging/884ab11e1d16911d3d41aae1334ca4b9.png

Thanks! Any help would be really appreciated.

Tcpdf::setDisplayMode()

PHP7.2.9
Accessing static property Com\Tecnick\Pdf\Tcpdf::$valid_zoom as non static in D:\www\photon\SchoolBusManager\vendor\tecnickcom\tc-lib-pdf\src\Tcpdf.php on line 170
Cause a warning of in_array() function in the same line.
Correct by :

if (is_numeric($zoom) || in_array($zoom, self::$valid_zoom)) {

LinearGradient prints wrong colors

Hello,
this is my code:

$pdf->LinearGradient($x, $y, $width, $height, $darkblue, $lightblue);

If I give colors in RGB like

$darkblue = array(2, 63, 17);
$lightblue = array(170, 195, 226);

the result is a sort of green instead of blue

If I give colors in CMYK format

$darkblue = array(251, 118, 0, 138);
$lightblue = array(64, 34, 0, 29);

the result is different bands of different colors with very few gradient (the blu I want, but then magenta, then violet, then amaranto and then again blue)

Can you reproduce the same issue?
Some hints?

Thank you in advance

Gianluca

About TCPDF flags.

Hello.

There is a code in TCPDF

$pdf->Button('submit', 30, 10, 'Submit', array('S'=>'SubmitForm', 'F'=>'http://localhost.ru/pdf.php#XFDF', 'Flags'=>array('ExportFormat')), array('lineWidth'=>2, 'borderStyle'=>'beveled', 'fillColor'=>array(128, 196, 255), 'strokeColor'=>array(64, 64, 64)));

Could you, please, tell me, where can i see all array Flags (such as 'F', 'S', 'ExportFormat' and so on).
I can't find it in documentation.

Thank you!

HTML Table Cell auto width

Hi,
i searched the web for it but did'n find any solution.

is there a way to output a table cell with auto width according to its content? (generated with html content/ writeHTML function).

for now my table cells has the same with.

greeting mike

Installation/usage issues with tc-lib-pdf

Hi,

First of all: thank you for your continuous efforts on TCPDF/tc-lib-pdf.
I've been looking into what library I should be using and yours seems to be having quite some features.

I've tried using tc-lib-pdf however I didn't got it to work and I'm unsure what I'm doing wrong.
When trying TCPDF I had no issues and could rather quickly find my way into creating a basic PDF. However I wonder what's the use of learning the "old" TCPDF when you're building tc-lib-pdf as it's successor(I'd rather immediately go that way). I've been trying to find some basic example on how to use your code but that fails.

IMHO I think the examples are great for TCPDF but the site is misleading in refering to the tc-lib-pdf repo by default (I only noticed after a while that that is why the examples didn't work).
Also: the installation notes seem very limited(actually hit the API limiter on github with the instructions on the site). I understand you want to make use of some technologies like composer. However for someone who's not been working with PHP that much recently it's unclear on what steps are now needed to make actual use of your project(for example the site refers to creating a composer.json but not if you'd need to execute anything else like: composer install).

My actual question is if you'd be so kind to make a basic project example using tc-lib-pdf.
So for example:
Get the git repository:
git clone ...
Get the dependencies;
composer install
Create a file:
example.php
Add the following to example.php to include tc-lib-pdf to your project (to make use of the namespaces, ...):
...
You can create a basic PDF like this:
...
To create and view the docs do;
...

And maybe clearly differentiate on the website between TCPDF and tc-lib-pdf (with the different repo names).

I think it'd help a lot of people in getting on the new tc-lib-pdf wagon.

Thanks in advance for your continuous efforts!

PDF preset standard.

Hello @nicolaasuni
Is there is any option for pdf to convert it in to High Quality Print as PDF preset
pdf-preset

I have created one .pdf file using TCPDF library in php. Which contain one image layer and above that one svg path. However this part are working well, But problem is i need that .pdf file in High Quality Print preset standard.

Please check attachment.

Any feedback will be much appreciate.

tcpdf datauri in writehtml

Hi, does tcpdf support datauri in writehtml src tags?

(i'm using elibyy/tcpdf-laravel)

i don't want to store the signatures from my clients on my server so instead i've tried to store them as datauri's in my db.

example code:

$html .='<img src="'.$data_uri.'" width="300">';
PDF::Writehtml($html);

i get an empty space where the signature should come.

i can achieve this with PDF::Image('a'.$datauri) however its not responsive to my pdf then..

Thanks in advance

Text annotation support utf-8

Hi Nicola,

When I add Hebrew text within text annotation, I cant so it well on Chrome browser (the latest versions) but it showing good on Firefox.
chrome :
image
Firefox :
image

I think it because chrome doesn't support encoding any more...

Is the text annotation function will support UTF-8 in the near future ? or there is others options to add the text that will be show good in Chrome ?

Thank you,
Roy

Radio Button as Initial State True Does Not Appear in Rendered PDF

I am using PHP code to set the initial state on a radio button. When I view the rendered PDF it doesn't show the checked button. I can mouse over and check the 'hidden' button and it then shows as checked --- any ideas ?

Using TCPDF 6.2.13 with Adobe Reader 15.020.20039 on Windows 7

Support "text-decoration" in SVG text

Hi Nicola,

First of all - thank you for tcPDF. You're a life-saver.

Would it be possible to add support for text-decoration attribute in SVG text.

Possible styles:

  • underline
  • overline
  • line-through

Currently, text-decoration is ignored when SVG is added to PDF.

    <g id="28493" transform="translate(201 242)">
        <text font-family="arial" font-size="177" font-weight="normal" text-decoration="underline" style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: bevil; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" >
            <tspan x="-59" y="55.75" fill="rgb(0, 0, 0)">A</tspan>
        </text>
    </g>

Thanks!

Mixing chinese and arabic characters in the safe HTML node blocks PDF generation

(I will report this in the new library, because I cannot open issues on the deprecated old one)

When mixing some RTL characters with some other UTF8 characters in the same HTML node, like when mixing Chinese characters and Arabic characters (嫀 ط), then TCPDF screams a notice and the PDF is not built.

This happens on latest 6.2 version of TCPDF (and on elder ones like 5.9), using PHP 5.6.25

Showcase:

set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__);
spl_autoload_register();
error_reporting(E_ALL);

$pdf = new TCPDF('P', 'mm', 'A4');

// This one works
//$string = "<span>&#23232;</span> <span>&#1591;</span>";
//
// This one fails
$string = "&#23232; &#1591;";

echo($string);
var_dump($string);

$pdf->AddPage();
$pdf->writeHTML($string);
$pdfContent = $pdf->Output('doc.pdf', 'S');
// Screams ( ! ) Notice: Undefined offset: 23232 in C:\wamp\www\TCPDF-master\include\tcpdf_fonts.php on line 2119

var_dump($pdfContent);

Result:
嫀 ط
C:\wamp\www\TCPDF-master\test-8576.php:16:string '嫀 ط' (length=16)

( ! ) Notice: Undefined offset: 23232 in C:\wamp\www\TCPDF-master\include\tcpdf_fonts.php on line 2119

And the PDF is not generated.

Documentation

Where to see the full documentation for the new version.

Adobe specification compliance failing with Jetty/Quercus engine

I am using TCPDF with jetty and quercus engine to generate PDFs. PDF are getting generated successfully but no text at all. When i did some preflights on generated pdf i found below error

Analyze Outlines.
Analyze Pages.
0x80410503 - E - The operator has an invalid number of operands.
- File: server.pdf
0x80410513 - E - An end text operator is missing.
- File: server.pdf
0x80410113 - E - The file is corrupt and cannot be repaired. Some of the contents can possibly be recovered.
- Page No.: 1
- File: server.pdf
Save output file.
0x80410503 - E - The operator has an invalid number of operands.
- Page No.: 1
- File: server.pdf
0x80410513 - E - An end text operator is missing.
- Page No.: 1
- File: server.pdf
Close file.
3-Heights(TM) PDF repair tool, evaluation license valid until unbounded

below is code --
` $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->setFontSubsetting(false);

    // set document information
    $pdf->SetCreator(PDF_CREATOR);
    $pdf->SetAuthor('Anil Funde');
    $pdf->SetTitle('TCPDF Example 002');
    $pdf->SetSubject('TCPDF Tutorial');
    $pdf->SetKeywords('TCPDF, PDF, example, test, guide');

    // remove default header/footer
    $pdf->setPrintHeader(false);
    $pdf->setPrintFooter(false);

    // set default monospaced font
    $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

    // set margins
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);

    // set auto page breaks
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

    // set image scale factor
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

    // set some language-dependent strings (optional)
    if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
        require_once(dirname(__FILE__).'/lang/eng.php');
        $pdf->setLanguageArray($l);
    }
    #$fontname = TCPDF_FONTS::addTTFfont('../fonts/TimesSRegular.ttf', 'TrueType','ansi', 32);
    
     // set font
    #$pdf->SetFont($fontname, '', 20);
    // ---------------------------------------------------------

   

    // add a page
    $pdf->AddPage();

    // set some text to print
    #$txt ="test222222222222";
    

    // print a block of text using Write()
    $pdf->Write(0, $txt, '', 0, 'C', true, 0, false, false, 0);
    
    // ---------------------------------------------------------

    //Close and output PDF document
    $pdf->Output('example_002.pdf', 'I');`

I tried same code in XAMP enviorenment (apache/php) and it worked very well there and pdf generated in xamp environment get validated successfully.

While debugging, on jett/quercus environment i removed write() call and tried to generate blank pdf, generated pdf get validated successfully. Looks like write() and similar methods messing up something.

PDF signature corrupt when exceeding max length

This error has occurred on TCPDF 6.0.87. I am not sure whether it will still occur in tc-lib-pdf.

When signing a PDF document, if signature exceeds signature_max_length, no error gets caught, no error message gets printed, but PDF document becomes corrupt.

When opening a signed PDF in Adobe Reader, it shows these errors :

While opening the file, it says

This file is damaged but is being repaired

The blue ribbon on top says

Certification by is invalid

When opening the signature panel, it says

Certified by %s

Details of errors say

There are errors in the formatting or information contained in this signature (support information: SigDict /Contents illegal data)

When clicking on "Certificate details", nothing happens

Screenshot:

Screenshot of problem

A sample PDF so signed can be found at https://witnesser.co/images/158571879168934339.pdf

A solution could probably be to detect signature length before inserting it, check whether it fits limit, and if not, either throw an error, or increase limit.

receiving error using old library. please HELP!

hello,
I have a question about the old version of the library. I'm trying to sign a pdf document and i keep getting this error :
Warning: openssl_pkcs7_sign(): error getting private key in C:\xampp\htdocs\ANA\TCPDF-masterV3\tcpdf.php on line 7600
Notice: Undefined offset: 1 in C:\xampp\htdocs\ANA\TCPDF-masterV3\tcpdf.php on line 7610
TCPDF ERROR: Some data has already been output, can't send PDF file
Sorry for posting here but the old version doesn't have an issues section. Any help would be appreciated . Thank you very much!

Anyone have success with signatures and timestamping?

TCPDF is currently my backbone when it comes to creating PDFs on the fly, everything else just seems to fall short when you get into complex requirements like emailing printing and now signing. Seriously thanks for all that!

We're running into an issue with the previous library and time stamping, I can see it was planned but never implemented, and I'm beginning to see why; it's not really complex just more of a pain to get the tsq for the pdf.

Essentially this is the process as I understand it, (I'm totally open for correction as I am nearly fried at this point with all of this)

  1. get a signing request -
  • to do this we need to do something like openssl ts -query -data TCPDFFILE.pdf -no_nonce -sha512 -cert -out file.tsq
  • Does anyone know the options for sending the PDF? does it have to be a file? could it be a string? Is there a way to write to a file object without tripping the output error inside TCPDF "Some output has already been written..."?
  1. CURL the tsq to the time stamp authority, which is pretty straightforward. We should get the tsr back.
  2. read the tsr that was sent back and then insert it into the PDF Signature.

If it were possible, I would think it would make sense to just emit the response from the timestamp authority to a variable to later be inserted into the signature. Same thing with the cert?

Like I said though, this is all very new to me and I'm looking to better understand the process to better implement it.

Image files referenced by SVG can only be located in the same document root as the current server

Hi,

  • My SVG:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="900" height="1162" style="background-color: rgba(255, 255, 255, 1)" viewBox="0 0 900 1162" xml:space="preserve">
    <g transform="translate(308.33 222.92)">
        <image id="28497" xlink:href="/var/www/server2/image.png" x="-41.6666666666665" y="-18.75" style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" width="83.333333333333" height="37.5" preserveAspectRatio="none"></image>
    </g>
</svg>
  • Document root of server responding to request: /var/www/server1/.
  • Printing that SVG on PDF document results in error - TCPDF fails to find /var/www/server2/image.png

The problem lies here: https://github.com/tecnickcom/TCPDF/blob/master/tcpdf.php#L24189. IMO, you should not be fixing absolute paths...

Thanks!

Font-converting failure

Hi,

if I convert a font using http://fonts.snm-portal.com I get a working font, but even if I convert a bold or heavy style, I get only a thin/regular one (char width is different but the chars itself are thin/regular).
Same happens when I use tcpdf_addfont.php to convert the fonts setting platform-id to 3 (windows).
When I set platform-id to 1 (mac) and encoding-id to 0 I get a correct looking font (bold/heavy) but it works only for ASCII-characters but not for example with german umlauts.

Any idea?

thank you and best regards

Gabriel

add new font

how can i add new fonts to this library and use it in creating pdfs

Custom font with weight support in MultiCell

Hi there,

I am looking for help regarding adding a custom font with Default, Italic and Bold style, as I tried a couple ways and con't figure out the proper way of doing it.

FontStyles::DEFAULT => TCPDF_FONTS::addTTFfont(public_path('fonts/modele-exports/avenir.ttf'), '', '', 32)

FontStyles::BOLD => TCPDF_FONTS::addTTFfont(public_path('fonts/modele-exports/avenirB.ttf'), '', '', 32)

FontStyles::ITALIC => TCPDF_FONTS::addTTFfont(public_path('fonts/modele-exports/avenirI.ttf'), '', '', 32)

if I then use SetFont with B or I followed by MultiCell, it works the whole text is properly formated. But If I use SetFont Default and use tags in my text, they are not respected. Using a default font works properly so I guess the problem comes from how I import the font or something similar

Is there a way to add the font so that different styles work correctly ?

Thanks

Bower Support

Can Bower support be added so that this can be pulled via Bower? Bower can do git pulls, but a module would be better.

TCpdf creating blank pdf

I'm using the TCpdf but I was facing one issue with the formatting.

In my application, we accepting the data from end users and based on provided data we create pdf using TCpdf. (using PHP)
The issue is when end users copy data from word document/ existing other pdf and paste into provided text area. so its include the word formatting and bullets and all. It's stored as it is in my database, Once I send that information to TCpdf then TCpdf skip the formatted data and generate blank pdf.

What is the status of this library ?

Thanks for all the amazing work.
I'm a big fan of TCPDF and use it in multiple projects, and I'd love to use an more up to date library.
Is this library useable for simple needs ?
Is there a roadmap or a backlog where we could pick tickets if we want to help ?

Please

Hi Guy!

Really thank you for make PDF library. It is very useful.

I have problem when make pdf with add timestamp and signature for pdf. Do you know any document relative with timestamp and signature function in PDF. Example

Hope you reply to me.
Thanks so much

Input Box issue

Hi TCPDF Team

I am using TCPDF for create PDF. I want to use input box and check box in PDF. Input box is working but i am not able to add height and width for input box and check boxes.
Please suggests me how we have to use height and width properties for input box and check boxes.

Regards
Mohit kumar
[email protected]

PDF/A 1b Validation

Hi there,
Thanks for TCPDF.

I've encountered some problems with validating PDF/A 1b seems there's a missing definition for:
<pdfaSchema:schema>Adobe PDF Schema</pdfaSchema:schema>

Apache preflight validation (java -jar preflight-app-2.0.11.jar flie-xxx.pdf) lead to:
7.5 : Error on MetaData, Missing pdfaSchema:property in type definition

Btw adding an extra definition to pdf schema solve the problem i've added a pull request for reference.

Also VeraPDF validation fails for font-glyphs related problem but seems that VeraPDF has some problems in fonts handling.

Thanks kind regards
Rob

about the new lib to create a non-blank page

image

I found that the parameter $data of the add() method has a key called content that is used to set the contents of the pdf page. But by setting the value of the content, the pdf which is new generated is still blank. What should I do to generate normal pdf whith content?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.