No error to place a watermark

-2

Does watermark pdf error exist in this code?

  

document index.php

   <?php
    session_start();
    ?>

<!DOCTYPE html>
<html lang="pt-br">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>teste</title>
    </head>
    <body>
        <h1>Cadastrar documento pdf com marca-d'água</h1>

        <form method="POST" action="marcarpdf.php" enctype="multipart/form-data">
            <label>Titulo do Artigo: </label>
            <input type="text" name="titulo_artigo"><br><br>

            <label>pdf </label>
            <input type="file" name="imagem"><br><br>

            <input type="submit" value="Cadastrar"><br><br>
        </form>

    </body>
</html>
  

marcapdf.php

<?php
require_once('pdfwatermarker/pdfwatermarker.php');
require_once('pdfwatermarker/pdfwatermark.php');

//Specify path to image. The image must have a 96 DPI resolution.
$watermark = new PDFWatermark('myimage.png'); 

//Set the position
$watermark->setPosition('bottomleft');

//Place watermark behind original PDF content. Default behavior places it over the content.
$watermark->setAsBackground();

//Specify the path to the existing pdf, the path to the new pdf file, and the watermark object
$watermarker = new PDFWatermarker('C:\test.pdf','C:\output.pdf',$watermark); 

//Set page range. Use 1-based index.
$watermarker->setPageRange(1,5);

//Save the new PDF to its specified location
$watermarker->savePdf(); 
?>

this code giving error but in php I believe that some code in php is missing someone could show me where I can make the changes?

    
asked by anonymous 10.05.2018 / 21:10

1 answer

1

The error is on the redirection page of your system, coming from action of <form> :

Itshouldhavephpattheend,accordingtothenameofthedocument.

<formmethod="POST" action="marcarpdf." enctype="multipart/form-data">
        <label>Titulo do Artigo: </label>
        <input type="text" name="titulo_artigo"><br><br>

        <label>pdf </label>
        <input type="file" name="imagem"><br><br>

        <input type="submit" value="Cadastrar"><br><br>
    </form>

Change to:

<form method="POST" action="marcarpdf.php" enctype="multipart/form-data">
    
11.05.2018 / 23:45