Git Product home page Git Product logo

pdf-merge's People

Stargazers

 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

pdf-merge's Issues

Header is added under pdf content

Hi,

I'm trying to add a header to my merged PDF documents, but the header gets placed under the original content. Is there a way to fix this?

Merged PDF opened in Illustrator
Header

Original PDF content moved to reveal the header
Original content moved

Uninitialized string offset

Hi, your code works fine and I can merge PDFs, it just throws some errors in the background - seems $data is either not an array or something else is happening there?

Error: Uninitialized string offset 54 on line: 843 in /var/www/site/vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php
Error: Uninitialized string offset 720 on line: 843 in /var/www/site/vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php
Error: Uninitialized string offset 54 on line: 843 in /var/www/site/vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php
Error: Uninitialized string offset 821 on line: 843 in /var/www/site/vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php
Error: Uninitialized string offset 54 on line: 843 in /var/www/site/vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php
Error: Uninitialized string offset 229 on line: 843 in /var/www/site/vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php

It was 2x 1-page PDFs that were being merged - not sure if that helps or not?

TCPDF header & footer lines added by default

image

There should not be these default header/footer lines added

print_header & print_footer are default true which can`t be changed with this library

Currently, I am forced to do this:

$pdfMerge = new PdfMerge(
    ['lc' => [255, 255, 255]], // normally we should not do this
    ['lc' => [255, 255, 255]], // normally we should not do this
);

Karriere\PdfMerge\Exceptions\FileNotFoundException

Hi... i want to ask why i got this error.
image
image

this is my code :
$pdfMerge = new PdfMerge();

$pdfMerge->add($value['dok1']);
$pdfMerge->add($value['dok2']);
$pdfMerge->add($value['dok3']);
$pdfMerge->add($value['dok4']);

$path = base_url('folder') . "/" . $nameFile;
$pdfMerge->merge($path);

$value['dok1'] ,etc have a value

but i still got this file not found error

i use php 7.2

Allowed memory size of 536870912 bytes exhausted when merging

Hi,

My implementation has worked great for a couple of weeks, until a couple of days ago, where I get the following error when trying to merge PDFs:

  Allowed memory size of 536870912 bytes exhausted (tried to allocate 67108872 bytes)

  at vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php:999

The files in question are:
cover_1700084041.pdf -> 143kb
file_9a9f2a78-c516-4e99-86b2-82039c7bdda9.pdf -> 1.1MB
termsAndConditions_1700084044.pdf -> 166 kb

I have confirmed that all PDFs are available at the provided path, and have also renamed the file names to see if special characters are the issue.

Previously I've had no issues merging over 30 pdf documents, many of them a couple of megabytes each.

Does anyone have any idea of what causes this issue?

Uninitialized string offset 22

Got that exception. Here's the full exception:
/lav-im/vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php#737ErrorException

    $objtype = ''; // object type to be returned
    $objval = ''; // object value to be returned
    // skip initial white space chars: \x00 null (NUL), \x09 horizontal tab (HT), \x0A line feed (LF), \x0C form feed (FF), \x0D carriage return (CR), \x20 space (SP)
    while (strspn($data[$offset], "\x00\x09\x0a\x0c\x0d\x20") == 1) {
        $offset++;
    }
    // get first char

The code is straight forward, this is it:

    $pages = $this->book->pages;
    $pdfMerge = new PdfMerge();
    foreach ( $pages as $pagePdf ) {
        $pageFileName = $pagePdf->fullPathFileName;
        $pdfMerge->add($fullPathFileName);
    }
    $pdfMerge->merge('fullBook.pdf');

PHP 8.2 Deprecation Warnings

Hi there,

On PHP 8.2 there are deprecation warnings like PHP Deprecated: Callables of the form ["TCPDI", "TCPDF::SetFont"] are deprecated in karriere/pdf-merge/tcpi/fpdf_tpl.php on line 278

Do you have plans to release support for PHP 8.2?

tcpdi_parser.php error when working with an array

I'm able to use and works perfectly combining PDF's if I define out each individual file.

However when I used it in an array I get the below error. These individual files I am able to do without an array and it works fine.
foreach ($final_array as $file) {
$filez = $file['file_path'];
$pdfMerge->add($filez);
}

Error
Notice: Uninitialized string offset: 3670 in /vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php on line 709
Notice: Uninitialized string offset: 3670 in /vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php on line 713
Notice: Uninitialized string offset: 3670 in /vendor/karriere/pdf-merge/tcpi/tcpdi_parser.php on line 815

Ambiguous class resolution "FPDF"

Hi ! I tried to use your package to merge PDFs and it works well, thank you!

However, at the installation via composer, I got this warning :
Warning: Ambiguous class resolution, "FPDF" was found 2x: in "C:/laragon/www/lapli/vendor/karriere/pdf-merge/tcpi/tcpdi.php" and "C:\laragon\www\lapli\vendor/setasign/fpdf/fpdf.php", the first will be used.

As you can see, I already use another package "Setasign/FPDF" to manipulate PDFs. It was fine to use it, until I couldn't because of a newer version of PDF (the reason I installed your package).

Now the problem is that my previous code using the Setasign package does not work anymore. I get this error :
Declaration of setasign\Fpdi\FpdfTplTrait::setPageFormat($size, $orientation) should be compatible with TCPDF::setPageFormat($format, $orientation = 'P')

Unfortunatly, I have no idea how to fix that T_T
Do you have some suggestions ?

?: Handling PDFs that are viewable but password-protected against changes

First, thank you for your contributions to the community -- your efforts are very much appreciated

Problem Statement

We have a PDF that can be opened and viewed without a password. However, the pdf does require a password for saving changes to the document.

We would like to create a merged PDF that includes the previously mentioned PDF but the process fails. Per developer,

fails when trying to import page (PDFMerge::merge() line 77) from password-protected PDF. It goes inside into tcpdi::ImportPage line 232 $parser->getContent() next to tcpdi_parser::getContent and fails in _rebuildContentStream() on line 1375

Question

Should this work? Do you have any ideas for a workaround for how to handle this?

TCPDF ERROR: Template does not exist!

Hi, I am encountering the following error "TCPDF ERROR: Template does not exist!" when trying to merge a specific PDF. How can I solve it? I cannot understand what it depends on, or rather what has that PDF that generates this error.

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.