SlideShare a Scribd company logo
1 of 4
Download to read offline
Explore GitHub
Search
Features
Blog
Sign up for free Sign in
Star 41
Fork 8

public psliwa / PdfBundle
Code
Network
Pull Requests 0
Issues 2
Graphs
PHP
1. PHP 100%
This bundle integrates Symfony2 with PHPPdf library. — Read more
http://ohey.pl
Clone in Windows
ZIP
HTTP SSH Git Read-Only https://github.com/psliwa/PdfBundle.git
Read-Only access
Tags 0
branch: master
Switch branches/tags
Filter branches/tags

Branches
Tags
1.0.x
master
zf1-in-backend
Nothing to show
Nothing to show
Files
Commits
Branches 3
71 commits
PdfBundle /
fix composer.json file
latest commit 623579091a
psliwa authored 14 days ago
Annotation
a year ago new @Pdf annotation argument (enableCache), fix DI configuration [psliwa]
Controller
7 months agoupdate composer.json, README and examples [psliwa]
DependencyInjection a year ago update supported PHPPdf version to 1.1.x branch [psliwa]
EventListener
a month ago [#28] responses with error code > 299 do not trigger pdf rendering [psliwa]
PHPPdf
a year ago support for bundle based paths in fonts configuration file and source… [psliwa]
Reflection
a year ago [#3] fix compatibility to new versions of JMS bundles [psliwa]
Resources
a year ago support for bundle based paths in fonts configuration file and source… [psliwa]
Templating
8 months agofix image location [psliwa]
Tests
a month ago [#28] responses with error code > 299 do not trigger pdf rendering [psliwa]
Twig
a year ago pdf_image Twig function [psliwa]
6 months agoreadme update [psliwa]
vendor
.travis.yml
a year ago travis-ci fix [psliwa]
CHANGELOG
5 months agoupdate version of PHPPdf in composer file [psliwa]
LICENSE
2 years ago initial commit [psliwa]
PsPdfBundle.php
2 years ago fix [psliwa]
README.markdown6 months agoreadme update [psliwa]
composer.json
14 days ago fix composer.json file [psliwa]
README.markdown

PsPdfBundle
This bundle integrates Symfony2 with PHPPdf library. Thanks to this bundle you can easily generate PDF or image (png, jpg) files.
Documentation of PHPPdf you can find on github (README file).

Installation
1. If you use composer to resolve dependencies, you can skip 2nd, 3rd and 4th steps. PsPdfBundle requires "minimum-stability" equals to dev. PHPPdf uses
zendframework packages, so if you want to use composer, you must add zendframework composer repository to your composer.json file.
"eoiois:[
rpstre"
{
"ye:"opsr,
tp" cmoe"
"r" "tp/pcae.edrmwr.o/
ul: ht:/akgsznfaeokcm"
}
,
{
"ye:"opsr,
tp" cmoe"
"r" "tp/pcaitog"
ul: ht:/akgs.r/
}
]

2. Add this bundle and PHPPdf library to deps file and update vendors:
[dBnl]
Pfude
gtgt/gtu.o/siaPfudegt
i=i:/ihbcmplw/dBnl.i
tre=bnlsP/dBnl
agt/ude/sPfude
[HPf
PPd]
gtgt/gtu.o/siaPPd.i
i=i:/ihbcmplw/HPfgt
vrinoii/..
eso=rgn11x

3. Download dependencies (for example ZF2) of PHPPdf library. You can skip this step, if your application has had dependency on ZF2 framework and Imagine already.
For more details see installation section of PHPPdf documentation.
ppvno/HPfvnospp
h edrPPd/edr.h

4. Register bundle, PHPPdf, Imagine and ZF libraries in autoloader:

/apatla.h
/p/uoodpp
$odr>eitraepcsary
lae-rgseNmsae(ra(
's = _DR_'./edrbnls,
P' > _I_./.vno/ude'
'HPf = _DR_'./edrPPd/i'
PPd' > _I_./.vno/HPflb,
'mgn'= ary_DR_'./edrPPd/i' _DR_'./edrPPd/i/edrIaielb)
Iaie > ra(_I_./.vno/HPflb, _I_./.vno/HPflbvno/mgn/i',
'ed = _DR_'./edrPPd/i/edrZn/irr'/I yuhv ue Z2pcae aray yusol si ti ety
Zn' > _I_./.vno/HPflbvno/edlbay,/f o ae sd F akgs led, o hud kp hs nr
'edd'= _DR_'./edrPPd/i/edrZnPflbay,
ZnPf > _I_./.vno/HPflbvno/edd/irr'
);
)

5. Register bundle in AppKernel:
/apApenlpp
/p/pKre.h
pbi fnto rgseBnls)
ulc ucin eitrude(
{
rtr ary
eun ra(
/ .
/ .
nwPdBnlsdBnl(,
e sPfudePPfude)
/ .
/ .
)
;
}

Configuration
All options are optional.
#apcni/ofgyl
p/ofgcni.m
p_d:
spf
ndsfl:~
oe_ie
fnsfl:~
ot_ie
cmlxatiue_ie ~
ope_trbtsfl:
clr_ie ~
oosfl:
ueccei_tlset ~
s_ah_nsyehe:
cce
ah:
tp:~
ye
otos ~
pin:
mrdw_tlsetflpt:~
akonsyehe_ieah
mrdw_ouettmlt_ieah ~
akondcmn_epaeflpt:
dcmn_asrtp:~
ouetpre_ye

nodes_file - path to file with nodes/tags definitions, internal nodes.xml file from PHPPdf library is used by default
fonts_file - path to file with fonts definitions, internal fonts.xml file from PHPPdf library is used by default
complex_attributes_file - path to file with complex attributes definitions, internal complex-attributes.xml file from PHPPdf library is used by default
colors_file - path to file with default palette of colors, internal colors.xml file from PHPPdf library is used by default
cache.type - type of cache, supported are all backend cache from Zend_Cache component (for instance File, Apc, Memcached, Sqlite etc.). File engine is used by
default.
cache.options - specyfic options for cache engine (for instance "cache_dir" for File engine). cache_dir by default is as same as kernel.cache_dir.
use_cache_in_stylesheet - stylesheet maching rules will be cache, if this option is set. In complex stylesheet cache significantly improves performance. Default is true, but
in dev environment cache should be off.
markdown_stylesheet_filepath - filepath of stylesheet for markdown parser
markdown_document_template_filepath - xml document template form output of markdown parser
document_parser_type - default parser type: xml or markdown

Images in source document
If you want to display image, you must provide absolute path to image file via "src" attribute of image tag. Asset Twig function dosn't work, because it converts image path to
relative path according to web directory. To make using of images easier, bundle provides Twig function, that converts image logical name to real, absolute path.
Example:
<d>
pf
<yai-ae
dnmcpg>
<- pfiae'udeaeiaenm.xeso' ->
!- d_mg(BnlNm:mg-aeetnin) <m sc"{pfiae'yfnWbofgrtrudebu-ro.n' }"/
ig r={ d_mg(SmoyeCniuaoBnl:learwpg) } >
<dnmcpg>
/yai-ae
<pf
/d>

Bundle based paths in fonts and document xml file
If you want to use custom fonts, you should create your own fonts.xml config file (default fonts filepath is PHPPdfResourcesconfigfonts.xml). To make easier defining fonts
paths, bundle based paths are supported. Example:
<- sm fnsxlfl ->
!- oe ot.m ie <tlcsc"SmBnl:ietf"/
iai r=%oeudefl.t% >

"%SomeBundle:file.ttf%" will be replaced by "path/to/SomeBundle/Resources/file.ttf"

Example
/ I cnrle
/ n otolr
/..
/.
uePdBnlnoainPf
s sPfudeAnttod;
/..
/.
/*
*
*@d(
Pf)
*
/
pbi fnto hlocin$ae
ulc ucin elAto(nm)
{
$omt=$hs>e(rqet)>e(_omt)
fra
ti-gt'eus'-gt'fra';
rtr $hs>edrsrnf'oeudeSmCnrle:elAto.sti' $omt,ary
eun ti-rne(pit(SmBnl:oeotolrhlocin%.wg, fra) ra(
'ae = $ae
nm' > nm,
);
)
}
/ i hlocinhm.wg
/ n elAto.tlti
Hlo{ nm }!
el { ae }
/ i hlocinpfti
/ n elAto.d.wg
<d>
pf
<yai-ae
dnmcpg>
Hlo{ nm }!
el { ae }
<dnmcpg>
/yai-ae
<pf
/d>

Bundle automatically detects pdf format (via _format) request and create pdf document from response.
Pdf annotation has four optional properties:
headers - associative array of specyfic headers
stylesheet - pdf stylesheet template file in standard Symfony2 notation ("Bundle:Controller:file.format.engine")
documentParserType - type of parser: xml or markdown
enableCache - pdf output should by cached? True or false, default: false. Hash (md5) from template and stylesheet content is a cache key, only PHPPdf invocation is
cached, controller is always called.

GitHub
About us
Blog
Contact & support
GitHub Enterprise
Site status
Applications
GitHub for Mac
GitHub for Windows
GitHub for Eclipse
GitHub mobile apps
Services
Gauges: Web analytics
Speaker Deck: Presentations
Gist: Code snippets
Job board
Documentation
GitHub Help
Developer API
GitHub Flavored Markdown
GitHub Pages
More
Training
Students & teachers
The Shop
Plans & pricing
The Octodex
© 2013 GitHub Inc. All rights reserved.
Terms of Service
Privacy
Security

Something went wrong with that request. Please try again.

More Related Content

Recently uploaded

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 

Recently uploaded (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

Featured

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Featured (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Crear un Pdf con un bundle en symfony 2

  • 1. Explore GitHub Search Features Blog Sign up for free Sign in Star 41 Fork 8 public psliwa / PdfBundle Code Network Pull Requests 0 Issues 2 Graphs PHP 1. PHP 100% This bundle integrates Symfony2 with PHPPdf library. — Read more http://ohey.pl Clone in Windows ZIP HTTP SSH Git Read-Only https://github.com/psliwa/PdfBundle.git Read-Only access Tags 0 branch: master Switch branches/tags Filter branches/tags Branches Tags 1.0.x master zf1-in-backend Nothing to show Nothing to show Files Commits Branches 3 71 commits PdfBundle / fix composer.json file latest commit 623579091a psliwa authored 14 days ago Annotation a year ago new @Pdf annotation argument (enableCache), fix DI configuration [psliwa] Controller 7 months agoupdate composer.json, README and examples [psliwa] DependencyInjection a year ago update supported PHPPdf version to 1.1.x branch [psliwa] EventListener a month ago [#28] responses with error code > 299 do not trigger pdf rendering [psliwa] PHPPdf a year ago support for bundle based paths in fonts configuration file and source… [psliwa] Reflection a year ago [#3] fix compatibility to new versions of JMS bundles [psliwa] Resources a year ago support for bundle based paths in fonts configuration file and source… [psliwa] Templating 8 months agofix image location [psliwa] Tests a month ago [#28] responses with error code > 299 do not trigger pdf rendering [psliwa] Twig a year ago pdf_image Twig function [psliwa] 6 months agoreadme update [psliwa] vendor .travis.yml a year ago travis-ci fix [psliwa] CHANGELOG 5 months agoupdate version of PHPPdf in composer file [psliwa] LICENSE 2 years ago initial commit [psliwa] PsPdfBundle.php 2 years ago fix [psliwa] README.markdown6 months agoreadme update [psliwa] composer.json 14 days ago fix composer.json file [psliwa]
  • 2. README.markdown PsPdfBundle This bundle integrates Symfony2 with PHPPdf library. Thanks to this bundle you can easily generate PDF or image (png, jpg) files. Documentation of PHPPdf you can find on github (README file). Installation 1. If you use composer to resolve dependencies, you can skip 2nd, 3rd and 4th steps. PsPdfBundle requires "minimum-stability" equals to dev. PHPPdf uses zendframework packages, so if you want to use composer, you must add zendframework composer repository to your composer.json file. "eoiois:[ rpstre" { "ye:"opsr, tp" cmoe" "r" "tp/pcae.edrmwr.o/ ul: ht:/akgsznfaeokcm" } , { "ye:"opsr, tp" cmoe" "r" "tp/pcaitog" ul: ht:/akgs.r/ } ] 2. Add this bundle and PHPPdf library to deps file and update vendors: [dBnl] Pfude gtgt/gtu.o/siaPfudegt i=i:/ihbcmplw/dBnl.i tre=bnlsP/dBnl agt/ude/sPfude [HPf PPd] gtgt/gtu.o/siaPPd.i i=i:/ihbcmplw/HPfgt vrinoii/.. eso=rgn11x 3. Download dependencies (for example ZF2) of PHPPdf library. You can skip this step, if your application has had dependency on ZF2 framework and Imagine already. For more details see installation section of PHPPdf documentation. ppvno/HPfvnospp h edrPPd/edr.h 4. Register bundle, PHPPdf, Imagine and ZF libraries in autoloader: /apatla.h /p/uoodpp $odr>eitraepcsary lae-rgseNmsae(ra( 's = _DR_'./edrbnls, P' > _I_./.vno/ude' 'HPf = _DR_'./edrPPd/i' PPd' > _I_./.vno/HPflb, 'mgn'= ary_DR_'./edrPPd/i' _DR_'./edrPPd/i/edrIaielb) Iaie > ra(_I_./.vno/HPflb, _I_./.vno/HPflbvno/mgn/i', 'ed = _DR_'./edrPPd/i/edrZn/irr'/I yuhv ue Z2pcae aray yusol si ti ety Zn' > _I_./.vno/HPflbvno/edlbay,/f o ae sd F akgs led, o hud kp hs nr 'edd'= _DR_'./edrPPd/i/edrZnPflbay, ZnPf > _I_./.vno/HPflbvno/edd/irr' ); ) 5. Register bundle in AppKernel: /apApenlpp /p/pKre.h pbi fnto rgseBnls) ulc ucin eitrude( { rtr ary eun ra( / . / . nwPdBnlsdBnl(, e sPfudePPfude) / . / . ) ; } Configuration All options are optional. #apcni/ofgyl p/ofgcni.m p_d: spf ndsfl:~ oe_ie fnsfl:~ ot_ie cmlxatiue_ie ~ ope_trbtsfl: clr_ie ~ oosfl: ueccei_tlset ~ s_ah_nsyehe: cce ah: tp:~ ye otos ~ pin: mrdw_tlsetflpt:~ akonsyehe_ieah mrdw_ouettmlt_ieah ~ akondcmn_epaeflpt: dcmn_asrtp:~ ouetpre_ye nodes_file - path to file with nodes/tags definitions, internal nodes.xml file from PHPPdf library is used by default fonts_file - path to file with fonts definitions, internal fonts.xml file from PHPPdf library is used by default complex_attributes_file - path to file with complex attributes definitions, internal complex-attributes.xml file from PHPPdf library is used by default colors_file - path to file with default palette of colors, internal colors.xml file from PHPPdf library is used by default cache.type - type of cache, supported are all backend cache from Zend_Cache component (for instance File, Apc, Memcached, Sqlite etc.). File engine is used by default. cache.options - specyfic options for cache engine (for instance "cache_dir" for File engine). cache_dir by default is as same as kernel.cache_dir. use_cache_in_stylesheet - stylesheet maching rules will be cache, if this option is set. In complex stylesheet cache significantly improves performance. Default is true, but
  • 3. in dev environment cache should be off. markdown_stylesheet_filepath - filepath of stylesheet for markdown parser markdown_document_template_filepath - xml document template form output of markdown parser document_parser_type - default parser type: xml or markdown Images in source document If you want to display image, you must provide absolute path to image file via "src" attribute of image tag. Asset Twig function dosn't work, because it converts image path to relative path according to web directory. To make using of images easier, bundle provides Twig function, that converts image logical name to real, absolute path. Example: <d> pf <yai-ae dnmcpg> <- pfiae'udeaeiaenm.xeso' -> !- d_mg(BnlNm:mg-aeetnin) <m sc"{pfiae'yfnWbofgrtrudebu-ro.n' }"/ ig r={ d_mg(SmoyeCniuaoBnl:learwpg) } > <dnmcpg> /yai-ae <pf /d> Bundle based paths in fonts and document xml file If you want to use custom fonts, you should create your own fonts.xml config file (default fonts filepath is PHPPdfResourcesconfigfonts.xml). To make easier defining fonts paths, bundle based paths are supported. Example: <- sm fnsxlfl -> !- oe ot.m ie <tlcsc"SmBnl:ietf"/ iai r=%oeudefl.t% > "%SomeBundle:file.ttf%" will be replaced by "path/to/SomeBundle/Resources/file.ttf" Example / I cnrle / n otolr /.. /. uePdBnlnoainPf s sPfudeAnttod; /.. /. /* * *@d( Pf) * / pbi fnto hlocin$ae ulc ucin elAto(nm) { $omt=$hs>e(rqet)>e(_omt) fra ti-gt'eus'-gt'fra'; rtr $hs>edrsrnf'oeudeSmCnrle:elAto.sti' $omt,ary eun ti-rne(pit(SmBnl:oeotolrhlocin%.wg, fra) ra( 'ae = $ae nm' > nm, ); ) } / i hlocinhm.wg / n elAto.tlti Hlo{ nm }! el { ae } / i hlocinpfti / n elAto.d.wg <d> pf <yai-ae dnmcpg> Hlo{ nm }! el { ae } <dnmcpg> /yai-ae <pf /d> Bundle automatically detects pdf format (via _format) request and create pdf document from response. Pdf annotation has four optional properties: headers - associative array of specyfic headers stylesheet - pdf stylesheet template file in standard Symfony2 notation ("Bundle:Controller:file.format.engine") documentParserType - type of parser: xml or markdown enableCache - pdf output should by cached? True or false, default: false. Hash (md5) from template and stylesheet content is a cache key, only PHPPdf invocation is cached, controller is always called. GitHub About us Blog Contact & support GitHub Enterprise Site status Applications GitHub for Mac GitHub for Windows GitHub for Eclipse GitHub mobile apps Services Gauges: Web analytics
  • 4. Speaker Deck: Presentations Gist: Code snippets Job board Documentation GitHub Help Developer API GitHub Flavored Markdown GitHub Pages More Training Students & teachers The Shop Plans & pricing The Octodex © 2013 GitHub Inc. All rights reserved. Terms of Service Privacy Security Something went wrong with that request. Please try again.