Giter VIP home page Giter VIP logo

php-pdf's Issues

Not Found on Windows

Fatal error: in vendor\cangelis\pdf\src\CanGelis\PDF\PDF.php on line 154

$pdf = new PDF("C:\DEV\wkhtmltopdf\bin\wkhtmltopdf.exe");
			
$pdf->marginTop('5mm');
$pdf->marginRight('5mm');
$pdf->marginBottom('5mm');
$pdf->marginLeft('5mm');
						
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename=test.pdf');
echo $pdf->loadHTML("<h1>HELLO WORLD</h1>")->get();

When Creating pdf i am getting error

PDF could not be created: "sh: 1: /tmp/4478858306fc097ae7.html: Permission denied\n"I am here

Also What command to pass constructor

/**
* Initialize temporary file names and folders
*
* @param $cmd
* @param null $tmpFolder
*/
public function __construct($cmd, $tmpFolder = null)
{
$this->cmd = $cmd;

	$this->fileName = uniqid(rand(0, 99999));

	if (is_null($tmpFolder))
	{
		$this->folder = sys_get_temp_dir();
	}
	else
	{
		$this->folder = $tmpFolder;
	}


}

Passing variable in CanGelis\PDF\PDF

When I run the code like this
new CanGelis\PDF\PDF('C:\xampp\htdocs\assessment\wkhtmltopdf\bin\wkhtmltopdf --cookie PHPSESSID u5ap7dnanp5be7gvfmpdr6sbrc');
It works absolutely fine
However, when I do it this way, my php goes in infinite loading
test = session_id(); $link = "C:\\xampp\htdocs\assessment\wkhtmltopdf\bin\wkhtmltopdf --cookie PHPSESSID "; $link = $link.$test; new CanGelis\PDF\PDF($link);
Am I doing something wrong? or how can I achieve this?

Prompt to download to disk?

I want to let the users to save the pdf themselves instead of storing it in my localhost server

Thanks

Daniel

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.