2

I am merging two pdfs using FPDI extended class like this.

function concat() {
    foreach ($this->files AS $file) {
        $page_count = $this->setSourceFile($file);
        for ($i = 1; $i <= $page_count; $i++) {
            $tplidx = $this->ImportPage($i);
            $s = $this->getTemplatesize($tplidx);
            if (strpos($file, 'test') || strpos($file, 'test_slip')) {
                $this->AddPage('L', array($s['w'], $s['h']));
            } else {
                $this->AddPage($this->DefOrientation, array($s['w'], $s['h']));
            }
            $this->useTemplate($tplidx);
        }
    }
}

When I output the merged file, One pdf with fillable field elements had all the elements vanished like the text and barcode etc on that. The other form however is fine. When I echo the fillable pdf form it works great but after this merge I loose all my data from that.

I would appreciate any pointers on this issue.

Manoj Sharma
  • 1,467
  • 2
  • 13
  • 20
oyeesh
  • 551
  • 9
  • 21

1 Answers1

2

FPDI does not support importing of form fields.

Jan Slabon
  • 4,736
  • 2
  • 14
  • 29
  • Thanks for the info. Is there any workaround for this that might help me. May be convert this fillable pdf form to a normal pdf somehow ? – oyeesh Jan 19 '17 at 21:28
  • @Shrav We (Setasign) offer other tools, which may help you but they are not free. You can use the [SetaPDF-Merger](https://www.setasign.com/merger) component to concatenate PDF documents including form fields or the [SetaPDF-FormFiller](https://www.setasign.com/formfiller) to e.g. flatten form fields. – Jan Slabon Jan 19 '17 at 22:05