Cambio textos FAQS seccion registro

This commit is contained in:
kquiroz
2023-08-17 19:45:01 -04:00
parent f4795ceacc
commit 84904eca6a
2102 changed files with 225 additions and 496829 deletions

View File

@@ -1,12 +0,0 @@
# These are supported funding model platforms
github: barryvdh
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -1,30 +0,0 @@
---
name: Bug report
about: Report an issue with the Dompdf wrapper
title: ''
labels: ''
assignees: ''
---
**This is just a Dompdf wrapper!**
I understand that this package is just a Laravel wrapper for https://github.com/dompdf/dompdf
Any issues with PDF rendering, CSS that is not applied correctly, aligning/fonts/characters etc that are not directly related to this package, should be reported there. When having doubts, please try to reproduce the issue with just dompdf. If it's also present there, do not open an issue here please.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
- Laravel and package version
- Input HTML/CSS
- Options / code
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

View File

@@ -1,27 +0,0 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- bug
- enhancement
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
Any issues with PDF rendering itself that are not directly related to this package,
should be reported on https://github.com/dompdf/dompdf instead.
When having doubts, please try to reproduce the issue with just dompdf.
If you believe this is an actual issue with the latest version of laravel-dompdf,
please reply to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
# Limit to only `issues` or `pulls`
only: issues

View File

@@ -1,5 +0,0 @@
/vendor
composer.phar
composer.lock
.DS_Store
/.idea

View File

@@ -1,37 +0,0 @@
{
"name": "barryvdh/laravel-dompdf",
"description": "A DOMPDF Wrapper for Laravel",
"license": "MIT",
"keywords": ["laravel", "dompdf", "pdf"],
"authors": [
{
"name": "Barry vd. Heuvel",
"email": "barryvdh@gmail.com"
}
],
"require": {
"php": ">=7",
"illuminate/support": "^5.5|^6|^7|^8",
"dompdf/dompdf": "^0.8"
},
"autoload": {
"psr-4": {
"Barryvdh\\DomPDF\\": "src"
}
},
"extra": {
"branch-alias": {
"dev-master": "0.8-dev"
},
"laravel": {
"providers": [
"Barryvdh\\DomPDF\\ServiceProvider"
],
"aliases": {
"PDF": "Barryvdh\\DomPDF\\Facade"
}
}
},
"minimum-stability": "dev"
}

View File

@@ -1,244 +0,0 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Settings
|--------------------------------------------------------------------------
|
| Set some default values. It is possible to add all defines that can be set
| in dompdf_config.inc.php. You can also override the entire config file.
|
*/
'show_warnings' => false, // Throw an Exception on warnings from dompdf
'orientation' => 'portrait',
'defines' => array(
/**
* The location of the DOMPDF font directory
*
* The location of the directory where DOMPDF will store fonts and font metrics
* Note: This directory must exist and be writable by the webserver process.
* *Please note the trailing slash.*
*
* Notes regarding fonts:
* Additional .afm font metrics can be added by executing load_font.php from command line.
*
* Only the original "Base 14 fonts" are present on all pdf viewers. Additional fonts must
* be embedded in the pdf file or the PDF may not display correctly. This can significantly
* increase file size unless font subsetting is enabled. Before embedding a font please
* review your rights under the font license.
*
* Any font specification in the source HTML is translated to the closest font available
* in the font directory.
*
* The pdf standard "Base 14 fonts" are:
* Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique,
* Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique,
* Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic,
* Symbol, ZapfDingbats.
*/
"font_dir" => storage_path('fonts/'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782)
/**
* The location of the DOMPDF font cache directory
*
* This directory contains the cached font metrics for the fonts used by DOMPDF.
* This directory can be the same as DOMPDF_FONT_DIR
*
* Note: This directory must exist and be writable by the webserver process.
*/
"font_cache" => storage_path('fonts/'),
/**
* The location of a temporary directory.
*
* The directory specified must be writeable by the webserver process.
* The temporary directory is required to download remote images and when
* using the PFDLib back end.
*/
"temp_dir" => sys_get_temp_dir(),
/**
* ==== IMPORTANT ====
*
* dompdf's "chroot": Prevents dompdf from accessing system files or other
* files on the webserver. All local files opened by dompdf must be in a
* subdirectory of this directory. DO NOT set it to '/' since this could
* allow an attacker to use dompdf to read any files on the server. This
* should be an absolute path.
* This is only checked on command line call by dompdf.php, but not by
* direct class use like:
* $dompdf = new DOMPDF(); $dompdf->load_html($htmldata); $dompdf->render(); $pdfdata = $dompdf->output();
*/
"chroot" => realpath(base_path()),
/**
* Whether to enable font subsetting or not.
*/
"enable_font_subsetting" => false,
/**
* The PDF rendering backend to use
*
* Valid settings are 'PDFLib', 'CPDF' (the bundled R&OS PDF class), 'GD' and
* 'auto'. 'auto' will look for PDFLib and use it if found, or if not it will
* fall back on CPDF. 'GD' renders PDFs to graphic files. {@link
* Canvas_Factory} ultimately determines which rendering class to instantiate
* based on this setting.
*
* Both PDFLib & CPDF rendering backends provide sufficient rendering
* capabilities for dompdf, however additional features (e.g. object,
* image and font support, etc.) differ between backends. Please see
* {@link PDFLib_Adapter} for more information on the PDFLib backend
* and {@link CPDF_Adapter} and lib/class.pdf.php for more information
* on CPDF. Also see the documentation for each backend at the links
* below.
*
* The GD rendering backend is a little different than PDFLib and
* CPDF. Several features of CPDF and PDFLib are not supported or do
* not make any sense when creating image files. For example,
* multiple pages are not supported, nor are PDF 'objects'. Have a
* look at {@link GD_Adapter} for more information. GD support is
* experimental, so use it at your own risk.
*
* @link http://www.pdflib.com
* @link http://www.ros.co.nz/pdf
* @link http://www.php.net/image
*/
"pdf_backend" => "CPDF",
/**
* PDFlib license key
*
* If you are using a licensed, commercial version of PDFlib, specify
* your license key here. If you are using PDFlib-Lite or are evaluating
* the commercial version of PDFlib, comment out this setting.
*
* @link http://www.pdflib.com
*
* If pdflib present in web server and auto or selected explicitely above,
* a real license code must exist!
*/
//"DOMPDF_PDFLIB_LICENSE" => "your license key here",
/**
* html target media view which should be rendered into pdf.
* List of types and parsing rules for future extensions:
* http://www.w3.org/TR/REC-html40/types.html
* screen, tty, tv, projection, handheld, print, braille, aural, all
* Note: aural is deprecated in CSS 2.1 because it is replaced by speech in CSS 3.
* Note, even though the generated pdf file is intended for print output,
* the desired content might be different (e.g. screen or projection view of html file).
* Therefore allow specification of content here.
*/
"default_media_type" => "screen",
/**
* The default paper size.
*
* North America standard is "letter"; other countries generally "a4"
*
* @see CPDF_Adapter::PAPER_SIZES for valid sizes ('letter', 'legal', 'A4', etc.)
*/
"default_paper_size" => "a4",
/**
* The default font family
*
* Used if no suitable fonts can be found. This must exist in the font folder.
* @var string
*/
"default_font" => "serif",
/**
* Image DPI setting
*
* This setting determines the default DPI setting for images and fonts. The
* DPI may be overridden for inline images by explictly setting the
* image's width & height style attributes (i.e. if the image's native
* width is 600 pixels and you specify the image's width as 72 points,
* the image will have a DPI of 600 in the rendered PDF. The DPI of
* background images can not be overridden and is controlled entirely
* via this parameter.
*
* For the purposes of DOMPDF, pixels per inch (PPI) = dots per inch (DPI).
* If a size in html is given as px (or without unit as image size),
* this tells the corresponding size in pt.
* This adjusts the relative sizes to be similar to the rendering of the
* html page in a reference browser.
*
* In pdf, always 1 pt = 1/72 inch
*
* Rendering resolution of various browsers in px per inch:
* Windows Firefox and Internet Explorer:
* SystemControl->Display properties->FontResolution: Default:96, largefonts:120, custom:?
* Linux Firefox:
* about:config *resolution: Default:96
* (xorg screen dimension in mm and Desktop font dpi settings are ignored)
*
* Take care about extra font/image zoom factor of browser.
*
* In images, <img> size in pixel attribute, img css style, are overriding
* the real image dimension in px for rendering.
*
* @var int
*/
"dpi" => 96,
/**
* Enable inline PHP
*
* If this setting is set to true then DOMPDF will automatically evaluate
* inline PHP contained within <script type="text/php"> ... </script> tags.
*
* Enabling this for documents you do not trust (e.g. arbitrary remote html
* pages) is a security risk. Set this option to false if you wish to process
* untrusted documents.
*
* @var bool
*/
"enable_php" => false,
/**
* Enable inline Javascript
*
* If this setting is set to true then DOMPDF will automatically insert
* JavaScript code contained within <script type="text/javascript"> ... </script> tags.
*
* @var bool
*/
"enable_javascript" => true,
/**
* Enable remote file access
*
* If this setting is set to true, DOMPDF will access remote sites for
* images and CSS files as required.
* This is required for part of test case www/test/image_variants.html through www/examples.php
*
* Attention!
* This can be a security risk, in particular in combination with DOMPDF_ENABLE_PHP and
* allowing remote access to dompdf.php or on allowing remote html code to be passed to
* $dompdf = new DOMPDF(, $dompdf->load_html(...,
* This allows anonymous users to download legally doubtful internet content which on
* tracing back appears to being downloaded by your server, or allows malicious php code
* in remote html pages to be executed by your server with your account privileges.
*
* @var bool
*/
"enable_remote" => true,
/**
* A ratio applied to the fonts height to be more like browsers' line height
*/
"font_height_ratio" => 1.1,
/**
* Use the more-than-experimental HTML5 Lib parser
*/
"enable_html5_parser" => false,
),
);

View File

@@ -1,119 +0,0 @@
## DOMPDF Wrapper for Laravel 5
### Laravel wrapper for [Dompdf HTML to PDF Converter](https://github.com/dompdf/dompdf)
Require this package in your composer.json and update composer. This will download the package and the dompdf + fontlib libraries also.
composer require barryvdh/laravel-dompdf
## Installation
### Laravel 5.x:
After updating composer, add the ServiceProvider to the providers array in config/app.php
Barryvdh\DomPDF\ServiceProvider::class,
You can optionally use the facade for shorter code. Add this to your facades:
'PDF' => Barryvdh\DomPDF\Facade::class,
### Lumen:
After updating composer add the following lines to register provider in `bootstrap/app.php`
```
$app->register(\Barryvdh\DomPDF\ServiceProvider::class);
```
To change the configuration, copy the config file to your config folder and enable it in `bootstrap/app.php`:
```
$app->configure('dompdf');
```
## Using
You can create a new DOMPDF instance and load a HTML string, file or view name. You can save it to a file, or stream (show in browser) or download.
$pdf = App::make('dompdf.wrapper');
$pdf->loadHTML('<h1>Test</h1>');
return $pdf->stream();
Or use the facade:
$pdf = PDF::loadView('pdf.invoice', $data);
return $pdf->download('invoice.pdf');
You can chain the methods:
return PDF::loadFile(public_path().'/myfile.html')->save('/path-to/my_stored_file.pdf')->stream('download.pdf');
You can change the orientation and paper size, and hide or show errors (by default, errors are shown when debug is on)
PDF::loadHTML($html)->setPaper('a4', 'landscape')->setWarnings(false)->save('myfile.pdf')
If you need the output as a string, you can get the rendered PDF with the output() function, so you can save/output it yourself.
Use `php artisan vendor:publish` to create a config file located at `config/dompdf.php` which will allow you to define local configurations to change some settings (default paper etc).
You can also use your ConfigProvider to set certain keys.
### Configuration
The defaults configuration settings are set in `config/dompdf.php`. Copy this file to your own config directory to modify the values. You can publish the config using this command:
php artisan vendor:publish --provider="Barryvdh\DomPDF\ServiceProvider"
You can still alter the dompdf options in your code before generating the pdf using this command:
PDF::setOptions(['dpi' => 150, 'defaultFont' => 'sans-serif']);
Available options and their defaults:
* __rootDir__: "{app_directory}/vendor/dompdf/dompdf"
* __tempDir__: "/tmp" _(available in config/dompdf.php)_
* __fontDir__: "{app_directory}/storage/fonts/" _(available in config/dompdf.php)_
* __fontCache__: "{app_directory}/storage/fonts/" _(available in config/dompdf.php)_
* __chroot__: "{app_directory}" _(available in config/dompdf.php)_
* __logOutputFile__: "/tmp/log.htm"
* __defaultMediaType__: "screen" _(available in config/dompdf.php)_
* __defaultPaperSize__: "a4" _(available in config/dompdf.php)_
* __defaultFont__: "serif" _(available in config/dompdf.php)_
* __dpi__: 96 _(available in config/dompdf.php)_
* __fontHeightRatio__: 1.1 _(available in config/dompdf.php)_
* __isPhpEnabled__: false _(available in config/dompdf.php)_
* __isRemoteEnabled__: true _(available in config/dompdf.php)_
* __isJavascriptEnabled__: true _(available in config/dompdf.php)_
* __isHtml5ParserEnabled__: false _(available in config/dompdf.php)_
* __isFontSubsettingEnabled__: false _(available in config/dompdf.php)_
* __debugPng__: false
* __debugKeepTemp__: false
* __debugCss__: false
* __debugLayout__: false
* __debugLayoutLines__: true
* __debugLayoutBlocks__: true
* __debugLayoutInline__: true
* __debugLayoutPaddingBox__: true
* __pdfBackend__: "CPDF" _(available in config/dompdf.php)_
* __pdflibLicense__: ""
* __adminUsername__: "user"
* __adminPassword__: "password"
### Tip: UTF-8 support
In your templates, set the UTF-8 Metatag:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
### Tip: Page breaks
You can use the CSS `page-break-before`/`page-break-after` properties to create a new page.
<style>
.page-break {
page-break-after: always;
}
</style>
<h1>Page 1</h1>
<div class="page-break"></div>
<h1>Page 2</h1>
### License
This DOMPDF Wrapper for Laravel is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

View File

@@ -1,45 +0,0 @@
<?php
namespace Barryvdh\DomPDF;
use Illuminate\Support\Facades\Facade as IlluminateFacade;
class Facade extends IlluminateFacade {
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor() { return 'dompdf.wrapper'; }
/**
* Resolve a new instance
*/
public static function __callStatic($method, $args)
{
$instance = static::$app->make(static::getFacadeAccessor());
switch (count($args))
{
case 0:
return $instance->$method();
case 1:
return $instance->$method($args[0]);
case 2:
return $instance->$method($args[0], $args[1]);
case 3:
return $instance->$method($args[0], $args[1], $args[2]);
case 4:
return $instance->$method($args[0], $args[1], $args[2], $args[3]);
default:
return call_user_func_array(array($instance, $method), $args);
}
}
}

View File

@@ -1,248 +0,0 @@
<?php
namespace Barryvdh\DomPDF;
use Dompdf\Dompdf;
use Dompdf\Options;
use Exception;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\Config\Repository as ConfigRepository;
use Illuminate\Http\Response;
/**
* A Laravel wrapper for Dompdf
*
* @package laravel-dompdf
* @author Barry vd. Heuvel
*/
class PDF{
/** @var Dompdf */
protected $dompdf;
/** @var \Illuminate\Contracts\Config\Repository */
protected $config;
/** @var \Illuminate\Filesystem\Filesystem */
protected $files;
/** @var \Illuminate\Contracts\View\Factory */
protected $view;
protected $rendered = false;
protected $showWarnings;
protected $public_path;
/**
* @param Dompdf $dompdf
* @param \Illuminate\Contracts\Config\Repository $config
* @param \Illuminate\Filesystem\Filesystem $files
* @param \Illuminate\Contracts\View\Factory $view
*/
public function __construct(Dompdf $dompdf, ConfigRepository $config, Filesystem $files, ViewFactory $view){
$this->dompdf = $dompdf;
$this->config = $config;
$this->files = $files;
$this->view = $view;
$this->showWarnings = $this->config->get('dompdf.show_warnings', false);
}
/**
* Get the DomPDF instance
*
* @return Dompdf
*/
public function getDomPDF(){
return $this->dompdf;
}
/**
* Set the paper size (default A4)
*
* @param string $paper
* @param string $orientation
* @return $this
*/
public function setPaper($paper, $orientation = 'portrait'){
$this->dompdf->setPaper($paper, $orientation);
return $this;
}
/**
* Show or hide warnings
*
* @param bool $warnings
* @return $this
*/
public function setWarnings($warnings){
$this->showWarnings = $warnings;
return $this;
}
/**
* Load a HTML string
*
* @param string $string
* @param string $encoding Not used yet
* @return static
*/
public function loadHTML($string, $encoding = null){
$string = $this->convertEntities($string);
$this->dompdf->loadHtml($string, $encoding);
$this->rendered = false;
return $this;
}
/**
* Load a HTML file
*
* @param string $file
* @return static
*/
public function loadFile($file){
$this->dompdf->loadHtmlFile($file);
$this->rendered = false;
return $this;
}
/**
* Add metadata info
*
* @param array $info
* @return static
*/
public function addInfo($info){
foreach($info as $name=>$value){
$this->dompdf->add_info($name, $value);
}
return $this;
}
/**
* Load a View and convert to HTML
*
* @param string $view
* @param array $data
* @param array $mergeData
* @param string $encoding Not used yet
* @return static
*/
public function loadView($view, $data = array(), $mergeData = array(), $encoding = null){
$html = $this->view->make($view, $data, $mergeData)->render();
return $this->loadHTML($html, $encoding);
}
/**
* Set/Change an option in DomPdf
*
* @param array $options
* @return static
*/
public function setOptions(array $options) {
$options = new Options($options);
$this->dompdf->setOptions($options);
return $this;
}
/**
* Output the PDF as a string.
*
* @return string The rendered PDF as string
*/
public function output(){
if(!$this->rendered){
$this->render();
}
return $this->dompdf->output();
}
/**
* Save the PDF to a file
*
* @param $filename
* @return static
*/
public function save($filename){
$this->files->put($filename, $this->output());
return $this;
}
/**
* Make the PDF downloadable by the user
*
* @param string $filename
* @return \Illuminate\Http\Response
*/
public function download($filename = 'document.pdf' ){
$output = $this->output();
return new Response($output, 200, array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="'.$filename.'"',
'Content-Length' => strlen($output),
));
}
/**
* Return a response with the PDF to show in the browser
*
* @param string $filename
* @return \Illuminate\Http\Response
*/
public function stream($filename = 'document.pdf' ){
$output = $this->output();
return new Response($output, 200, array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'inline; filename="'.$filename.'"',
));
}
/**
* Render the PDF
*/
protected function render(){
if(!$this->dompdf){
throw new Exception('DOMPDF not created yet');
}
$this->dompdf->render();
if ( $this->showWarnings ) {
global $_dompdf_warnings;
if(!empty($_dompdf_warnings) && count($_dompdf_warnings)){
$warnings = '';
foreach ($_dompdf_warnings as $msg){
$warnings .= $msg . "\n";
}
// $warnings .= $this->dompdf->get_canvas()->get_cpdf()->messages;
if(!empty($warnings)){
throw new Exception($warnings);
}
}
}
$this->rendered = true;
}
public function setEncryption($password) {
if (!$this->dompdf) {
throw new Exception("DOMPDF not created yet");
}
$this->render();
return $this->dompdf->getCanvas()->get_cpdf()->setEncryption("pass", $password);
}
protected function convertEntities($subject){
$entities = array(
'€' => '&#0128;',
'£' => '&pound;',
);
foreach($entities as $search => $replace){
$subject = str_replace($search, $replace, $subject);
}
return $subject;
}
}

View File

@@ -1,91 +0,0 @@
<?php
namespace Barryvdh\DomPDF;
use Dompdf\Dompdf;
use Exception;
use Illuminate\Support\Str;
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
class ServiceProvider extends IlluminateServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Register the service provider.
*
* @throws \Exception
* @return void
*/
public function register()
{
$configPath = __DIR__.'/../config/dompdf.php';
$this->mergeConfigFrom($configPath, 'dompdf');
$this->app->bind('dompdf.options', function(){
$defines = $this->app['config']->get('dompdf.defines');
if ($defines) {
$options = [];
foreach ($defines as $key => $value) {
$key = strtolower(str_replace('DOMPDF_', '', $key));
$options[$key] = $value;
}
} else {
$options = $this->app['config']->get('dompdf.options');
}
return $options;
});
$this->app->bind('dompdf', function() {
$options = $this->app->make('dompdf.options');
$dompdf = new Dompdf($options);
$dompdf->setBasePath(realpath(base_path('public')));
return $dompdf;
});
$this->app->alias('dompdf', Dompdf::class);
$this->app->bind('dompdf.wrapper', function ($app) {
return new PDF($app['dompdf'], $app['config'], $app['files'], $app['view']);
});
}
/**
* Check if package is running under Lumen app
*
* @return bool
*/
protected function isLumen()
{
return Str::contains($this->app->version(), 'Lumen') === true;
}
public function boot()
{
if (! $this->isLumen()) {
$configPath = __DIR__.'/../config/dompdf.php';
$this->publishes([$configPath => config_path('dompdf.php')], 'config');
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array('dompdf', 'dompdf.options', 'dompdf.wrapper');
}
}