Coder Social home page Coder Social logo

Comments (33)

Ohda avatar Ohda commented on August 15, 2024 19

Hello. Any update on an possible release date ?

from tc-lib-pdf.

EduVillas avatar EduVillas commented on August 15, 2024 13

What about php 8.0 ???

from tc-lib-pdf.

nicolaasuni avatar nicolaasuni commented on August 15, 2024 8

Hi, thank you for the help offers.
People can contribute either via PR or sending donations following the link in the README.md.

The overall project is almost complete but I struggle to find the time to complete the core functions in the main library.
All the dependency libraries are complete and some of them can also be used with the old TCPDF library:

  • tc-lib-barcode
  • tc-lib-color
  • tc-lib-pdf-image
  • tc-lib-pdf-font
  • tc-lib-file
  • tc-lib-pdf-encrypt
  • tc-lib-unicode-data
  • tc-lib-unicode
  • tc-lib-pdf-page
  • tc-lib-pdf-graph

The main library (tc-lib-pdf) can now build a blank page.
The aim is to complete the Output.php file first and then start adding the basic functions to print a text cell, etc.

In the Output file the incomplete functions have an empty body and they are marked with a @todo comment.

from tc-lib-pdf.

mklemarczyk avatar mklemarczyk commented on August 15, 2024 6

That is best project for PDF in php, do you need some help with it?

from tc-lib-pdf.

mcgreevyd avatar mcgreevyd commented on August 15, 2024 4

Any news on this?

from tc-lib-pdf.

divinity76 avatar divinity76 commented on August 15, 2024 1

@semaex a 3rd party patch is available, but @nicolaasuni has indicated that no patches will be accepted upstream because TCPDF is "frozen"

from tc-lib-pdf.

xperseguers avatar xperseguers commented on August 15, 2024 1

@gerardreches Using with PHP 7.4 for a long time, not facing any problems with my use cases.

from tc-lib-pdf.

xperseguers avatar xperseguers commented on August 15, 2024 1

I had a reference to that repository but after double-checking, I'm actually using "tecnickcom/tcpdf": "dev-main", in my composer.json files, so the development branch of that package.

from tc-lib-pdf.

nicolaasuni avatar nicolaasuni commented on August 15, 2024

The old library should support PHP7, I merged some changes recently.
The new library is currently progressing very slowly because I am quite busy but more than 90% of the code is there (now spread across independent libraries).

from tc-lib-pdf.

nicolaasuni avatar nicolaasuni commented on August 15, 2024

Note that the current version of the new library has an example that generates a blank page!
There are some ready methods also to add fonts, graphics and barcodes but some essential methods for text are still missing.

from tc-lib-pdf.

divinity76 avatar divinity76 commented on August 15, 2024

i have been using the old library on php 7.0 in production for months without (php7-related) problems, so yeah, it supports PHP7 just fine.

from tc-lib-pdf.

MacGritsch avatar MacGritsch commented on August 15, 2024

Thank you for the information.
So its best to use the old version.
Are there still plans to finish this new version?

thank you for all your efforts and best regards

from tc-lib-pdf.

divinity76 avatar divinity76 commented on August 15, 2024

@mklemarczyk the current status, the way i see it (and use it) is: the old lib is production ready, the new lib is not. so yeah, unless you're planning on helping out the development of the new version, use the old version for now.

from tc-lib-pdf.

semaex avatar semaex commented on August 15, 2024

Hi,

I have a project with old tecnickcom/tcpdf and with new php 7.2 version it doesn't work anymore.

each() method used in tcpdf.php file is deprecated.

@nicolaasuni is possible to update old version? I know is not manteined anymore but I think is a small bug and the new version is not ready yet...

Thanxs for this good library ;)

from tc-lib-pdf.

MacGritsch avatar MacGritsch commented on August 15, 2024

@semaex you can simply apply this patch:

diff --git a/tcpdf.php b/tcpdf.php
old mode 100755
new mode 100644
index 65196e7..89223d0
--- a/tcpdf.php
+++ b/tcpdf.php
@@ -12582,7 +12582,7 @@ class TCPDF {
 		$k = $this->k;
 		$this->javascript .= sprintf("f".$name."=this.addField('%s','%s',%u,[%F,%F,%F,%F]);", $name, $type, $this->PageNo()-1, $x*$k, ($this->h-$y)*$k+1, ($x+$w)*$k, ($this->h-$y-$h)*$k+1)."\n";
 		$this->javascript .= 'f'.$name.'.textSize='.$this->FontSizePt.";\n";
-		while (list($key, $val) = each($prop)) {
+		foreach($prop as $key => $val) {
 			if (strcmp(substr($key, -5), 'Color') == 0) {
 				$val = TCPDF_COLORS::_JScolor($val);
 			} else {
@@ -16545,7 +16545,7 @@ class TCPDF {
 					// get attributes
 					preg_match_all('/([^=\s]*)[\s]*=[\s]*"([^"]*)"/', $element, $attr_array, PREG_PATTERN_ORDER);
 					$dom[$key]['attribute'] = array(); // reset attribute array
-					while (list($id, $name) = each($attr_array[1])) {
+                    foreach($attr_array[1] as $id => $name) {
 						$dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id];
 					}
 					if (!empty($css)) {
@@ -16558,7 +16558,7 @@ class TCPDF {
 						// get style attributes
 						preg_match_all('/([^;:\s]*):([^;]*)/', $dom[$key]['attribute']['style'], $style_array, PREG_PATTERN_ORDER);
 						$dom[$key]['style'] = array(); // reset style attribute array
-						while (list($id, $name) = each($style_array[1])) {
+                        foreach($style_array[1] as $id => $name) {
 							// in case of duplicate attribute the last replace the previous
 							$dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]);
 						}

from tc-lib-pdf.

semaex avatar semaex commented on August 15, 2024

Thanxs MacGritsch. I know how to solve this bug but I need the changes persist in oficial repo because my deploy system with composer downloads directly from authors repo.

Any ideas?

from tc-lib-pdf.

MacGritsch avatar MacGritsch commented on August 15, 2024

@semaex you could create a (private) fork, apply the patch and use that fork in your composer files.

from tc-lib-pdf.

semaex avatar semaex commented on August 15, 2024

@MacGritsch @divinity76 Thanxs for ideas, I'll do this ;)

from tc-lib-pdf.

pyrographics avatar pyrographics commented on August 15, 2024

Looking forward to the release of the new library. What is the best way to troubleshoot PDF corruption using the old tcpdf? Sometimes the PDF exports correctly and sometimes it is corrupted. No error is generated so I'm stuck as to what is causing it.

from tc-lib-pdf.

xperseguers avatar xperseguers commented on August 15, 2024

Could someone tell me where to look for some basic up-to-date samples? https://tcpdf.org/examples/ are all based on an older version of the library, example in this project only shows creating a blank page, but nothing regarding adding some text, adding some graphics, adding a barcode, ...

from tc-lib-pdf.

extcode avatar extcode commented on August 15, 2024

@semaex you can also use the official repository and use https://github.com/cweagans/composer-patches to patch the files with composer.

from tc-lib-pdf.

semaex avatar semaex commented on August 15, 2024

thanxs to everyone ;)

from tc-lib-pdf.

gnurob avatar gnurob commented on August 15, 2024

Are there ways to offer some support to this project besides coding?

from tc-lib-pdf.

kdruzycki avatar kdruzycki commented on August 15, 2024

Any news? :)

from tc-lib-pdf.

connorhu avatar connorhu commented on August 15, 2024

@nicolaasuni Do you have any list of release blocker tasks?

from tc-lib-pdf.

rabol avatar rabol commented on August 15, 2024

@nicolaasuni let us know how we can help, please

from tc-lib-pdf.

mklemarczyk avatar mklemarczyk commented on August 15, 2024

Super news, I will take a look in a free time to try to help with finishing the library.

from tc-lib-pdf.

gerardreches avatar gerardreches commented on August 15, 2024

I need to generate PDF certificates on my site using PHP (using PHP 7.4). Does someone know if this library already works or if the old one is compatible with PHP 7.4?

Thanks!

from tc-lib-pdf.

gerardreches avatar gerardreches commented on August 15, 2024

@gerardreches Using with PHP 7.4 for a long time, not facing any problems with my use cases.

Hi Xavier!

Are you talking about this library (the new one under development) or the old one (stable)?

Thanks!

from tc-lib-pdf.

gerardreches avatar gerardreches commented on August 15, 2024

I had a reference to that repository but after double-checking, I'm actually using "tecnickcom/tcpdf": "dev-main", in my composer.json files, so the development branch of that package.

I will give it a try then, thank you!

from tc-lib-pdf.

mahouha avatar mahouha commented on August 15, 2024

I need to generate PDF certificates on my site using PHP (using PHP 7.4). Does someone know if this library already works or if the old one is compatible with PHP 7.4?

Thanks!

have you a solution ??

from tc-lib-pdf.

xperseguers avatar xperseguers commented on August 15, 2024

@mahouha Please read my answer following the question, from April last year. in short: it works! just use dev-main in your composer.json

from tc-lib-pdf.

MacGritsch avatar MacGritsch commented on August 15, 2024

Old version also works with PHP 8.x

from tc-lib-pdf.

Related Issues (20)

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.