Giter Site home page Giter Site logo

php-pdftk-toolkit'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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-pdftk-toolkit's Issues

Assign each PDF a multi-char handle (pdftk-1.45)

This functionality is causing me some headache. I have spent the last couple days trying to figure out why this toolkit failed to merge two pdf files that in fact existed. It turns out I don't have pdftk 1.45, and my host is giving me the runaround on upgrading pdftk 1.44. What would it take to add a configuration to remove the handle function for backwards compatibility? I've temporarily made the following changes which appears to be working

    //Assign each PDF a multi-char handle (pdftk-1.45)
    foreach ($this->aInputFiles AS $iKey => $oFile) {
        if ($oFile->getData() != null) {
            $aCommand[] = "-";
            $this->sInputData = $iKey;
        } else {
            $handle = chr(65 + floor($iKey/26)%26).chr(65 + $iKey%26);
            //$aCommand[] = $handle . "='" . $oFile->getFilename()."'";
            $aCommand[] = $oFile->getFilename();            }
    }

    //Fetch command for each input file
    if ($total_inputs > 1) {
        foreach ($this->aInputFiles AS $iKey => $oFile) {
            $handle = chr(65 + floor($iKey/26)%26).chr(65 + $iKey%26);
            //$aCommand[] = $handle . $oFile->_getCatCommand();
            $aCommand[] = $oFile->_getCatCommand();
        }
    }

Cannot rotate

I'm doing this:

$docpdf=new pdftk();

$docpdf->setInputFile(array('filename' => "test.pdf",'rotation' => 180))
->setOutputFile("test.pdf_rotated")
->_renderPdf();

But the resulting PDF is identical to the original, and it is not rotated

error example2

First of all, thanks for your work on this

my issue is when i tried to run the demo example2 i got the following error :

Fatal error: Uncaught exception 'Exception' with message 'System error: Le chemin d' in C:\wamp64\www\php-pdftk-toolkit-master\src\Pdftk\Pdftk.php on line 496

Thanks for your help

setInputFile filters don't work if it is called only once

First of all, thanks for your work on this. I searched all over for a solid php pdf manipulator and love this one.

My issue is that I want to explode a multipage pdf into separate pdf files. So I have a simple loop and I'm using setInputFile() and I thought I would be good. However, the start_page and end_page options that I send it are only working when I use setInputFile() a second time, however I don't want to add a second input file.

I've poked around a bit in your code and couldn't immediately figure it out, so I'm hoping I'm doing something wrong, or you could point me to what I need to alter to get this working.

Oh, and can your class count the pages in the pdf? I didn't see anything about it in the examples or the codebase. It seems that the underlying pdftk library supports it with the numpages property, so maybe it just needs to be implemented here?

Thanks,
Adam

getPdftkVersion returns array instead of string

It seems to be a problem with "getPdftkVersion" method. The method should return a string but instead it returns an array.

I think the problem appears because "_exec" returns an array (array('stdout' => '', 'stderr' => '', 'return' => '')) and the "getPdftkVersion" returns it directly instead of returning the "stdout" from it.

filenames with spaces

I'm running into issues with spaces in filenames. I'm not sure what the fix would be, but I'm having to rename files before processing them.

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.