padocia / laravel-nova-pdf Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Great Plugin
Getting this error on Linux Server
The command \"PATH=$PATH:/usr/local/bin:/opt/homebrew/bin NODE_PATH=
npm root -g node '/var/app/current/vendor/spatie/browsershot/src/../bin/browser.js' '{\"url\":\"file:\\/\\/\\/tmp\\/1068099769-0897319001641134454\\/index.html\",\"action\":\"pdf\",\"options\":{\"args\":[],\"viewport\":{\"width\":800,\"height\":600},\"displayHeaderFooter\":false}}'\" failed.\n\nExit Code: 127(Command not found)\n\nWorking directory: /var/app/current/public\n\nOutput:\n================\n\n\nError Output:\n================\nsh: npm: command not found\nsh: node: command not found\n
image doesn't work when you use asset()
Hi, when i try to add image to blade file i get this error:
TimeoutError: Navigation timeout of 30000 ms exceeded
Someone can help me solve this,
Is there a simple way to append disk stored pdf file(s) to the generated file?
Is there a way to pass a field of the model the action is currently executed?
Like
protected function filename()
{
return $this->models->first()->name . "-Report.pdf";
}
Thanks!
Hi,
I’ve just installed your package which seems that is great but I am having the following issue:
When running the action to download pdf I am getting the error ……Error output== == ‘node’ is not recognized as an internal or external command!operable program or batch file
I’ve already set the variable path for node.js in my windows 7 control panel
Why is that happening and it would be appreciated if you guide me how to fix this
Thanks
hello.. gonna tag the fix for the PSR-4 fix?
the pdf file upon opening returns
We can't open this file
Something went wrong.
and the size of the file is 0
Having this package in nova 4 would be great
Hello,
Thanks for this package that I am using in my current project.
PHPStan is complaining about something:
Declaration of Padocia\NovaPdf\Actions\ExportToPdf::defaultFilename() must be compatible with Padocia\NovaPdf\Concerns\WithFilename::defaultFilename(): string in vendor/padocia/laravel-nova-pdf/src/Actions/ExportToPdf.php on line 103.
I think this is because the return type is specified on the abstract method but not on the other one. Can you have a look please ?
Thanks in advance.
Hi,
In your preview photo shows that you are able to select multiple files simultaneously.
If i select more than one rows it just download the pdf that produced from the first model and ignore the others.
Am i doing something wrong?
Thanks for your package
Pampos
Hi, i am in live site and after i followed this #8 i did this:
npm install -g puppeteer
npm link puppeteer
but when i use tinker: Spatie\Browsershot\Browsershot::url('https://nova.laravel.com')->save('test.pdf')
I get this error:
Symfony\Component\Process\Exception\ProcessFailedException with message 'The command "PATH=$PATH:/usr/local/bin NODE_PATH=npm root -g
node '/var/www/dotorm.cv/releases/20211123160705/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"https://nova.laravel.com","action":"pdf","options":{"path":"test.pdf","args":[],"viewport":{"width":800,"height":600}}}'" failed.
Exit Code: 1(General error)
Working directory: /var/www/dotorm.cv/releases/20211123160705
Error: Failed to launch the browser process!
/usr/lib/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/usr/lib/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:203:20)
at Interface.<anonymous> (/usr/lib/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:68)
at Interface.emit (events.js:388:22)
at Interface.close (readline.js:429:8)
at Socket.onend (readline.js:202:10)
at Socket.emit (events.js:388:22)
at endReadableNT (internal/streams/readable.js:1336:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Some one can help me pass this error, please (I get this error only on live site in my computer all is working good).
Great plugin!!
just a minor things noticed in the Reame during the installation
composer padocia/laravel-nova-pdf
=> missing require
npm install puppeteer
is also required for your package to work but missing in the document.message: "The command "PATH=$PATH:/usr/local/bin NODE_PATH=`npm root -g` node '/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"file:\/\/\/var\/tmp\/559450596-0497906001615420802\/index.html","action":"pdf","options":{"args":[],"viewport":{"width":800,"height":600},"displayHeaderFooter":false}}'" failed.↵↵Exit Code: 1(General error)↵↵Working directory: /public↵↵Output:↵================↵↵↵Error Output:↵================↵node:internal/modules/cjs/loader:900↵ const err = new Error(message);↵ ^↵↵Error: Cannot find module 'puppeteer'↵Require stack:↵- /vendor/spatie/browsershot/bin/browser.js↵ at Function.Module._resolveFilename (node:internal/modules/cjs/loader:900:15)↵ at Function.Module._load (node:internal/modules/cjs/loader:745:27)↵ at Module.require (node:internal/modules/cjs/loader:972:19)↵ at require (node:internal/modules/cjs/helpers:88:18)↵ at callChrome (/vendor/spatie/browsershot/bin/browser.js:44:25)↵ at Object.<anonymous> (/vendor/spatie/browsershot/bin/browser.js:284:2)↵ at Module._compile (node:internal/modules/cjs/loader:1083:30)↵ at Object.Module._extensions..js (node:internal/modules/cjs/loader:1112:10)↵ at Module.load (node:internal/modules/cjs/loader:948:32)↵ at Function.Module._load (node:internal/modules/cjs/loader:789:14) {↵ code: 'MODULE_NOT_FOUND',↵ requireStack: [↵ '/vendor/spatie/browsershot/bin/browser.js'↵ ]↵}↵"
Hi, How to save pdf on storage before preview then, and how can i preview pdf directly on browser without download.
i install it on live site. but after the download the size is zero.
Hi there!
I'm trying to use some Tailwind classes to customize background colors or text colors, but doesn't been reflected in the PDF. Others classes like text-2xl
or font-extrabold
are ok, but if you try to use bg-purple-300
nothing happen.
<!doctype html>
<html>
<head>
<title>Laravel Nova Pdf Template</title>
<meta charset="UTF-8"/>
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
@foreach ($stylesContents as $stylesContent)
<style>
{{ $stylesContent }}
</style>
@endforeach
<style>
html, body {
height: 100%;
}
</style>
</head>
<body class="tailwind-container">
<section>
@foreach ($models as $model)
<div class="grid grid-cols-4 gap-4">
<div class="bg-purple-300 h-12 rounded-md flex justify-center items-center text-white text-2xl font-extrabold">{{ $model->getKey() }}</div>
<div class="bg-purple-300 h-12 rounded-md flex justify-center items-center text-white text-2xl font-extrabold">{{ $model->batch->name }}</div>
<div class="bg-purple-300 h-12 rounded-md flex justify-center items-center text-white text-2xl font-extrabold">{{ $model->telephone->telephone }}</div>
<div class="bg-purple-300 h-12 rounded-md flex justify-center items-center text-white text-2xl font-extrabold">{{ $model->status->name }} ({{ $model->status->code }})</div>
</div>
@endforeach
</section>
</body>
</html>
As you can see the template has been simplifies as max as possible in order to don't have any conflictive CSS class
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.