1 users online. Create an account or sign in to join them.Users
URL to PDF
This is an open discussion with 40 replies, filed under Extensions.
Search
@brendo — ah ! sounds awesome
Any ideas how to get a redirect past via $_POST to work?
Never mind... I was setting $_POST['redirect'] in a custom event and thought it was the extension. Setting $_REQUEST['redirect'] worked.
Hi, first of all, thanks for this impressive extension.
Is it possible to embed images in the pdf? For me the result is an error. I saw on tcpdf that it s possible but as i m more a graphic designer than a developer i don't know how to fix this the error.
Yeah should be possible. Check that the cache folder in that error actually exists and is writable.
Yeaaaaaaaaah :-D The cache folder was missing! Thank you!
It took me one day to find a way to use my font for the pdf, so for the non-developpers, here is a mini tutorial:
- You need a .ttf version of your font, if it's in another format, you can use an online font converter
- Also online, you can convert your .ttf font to tcpdf format here, you only need the .php and .z formats. You have to respect the naming of the font and input in the convert the right name for the result. Your Font has to be named yourfont, the italic version will be named yourfonti, the bold yourfontb and the bold italic will be yourfontbi.
- Then put the 8 resulted files in extensions/urltopdf/lib/tcpdf/fonts
- Edit the file extensions/urltopdf/extension.driver.php, line 143 you can add a new line with $pdf->SetFont("yourfont");
- Enjoy the new result that follow your graphical guidelines
I am dreaming of css3 goodness in my invoices; gradient backgrounds, rounded corners, textshadow, text rotation,.... So eventually should make an extension like this but with the mPDF library. In the meantime if anybody would beat me to this, please do keep us posted.
It's interesting to note that it appears mPDF is just TCPDF but with better CSS support. The majority of the code (at a glance) looks identical, so if you had a spare hour or so, you could probably drop the mPDF library in and try to update the code to work with it. Hopefully. With any luck :)
Has anyone managed to include an image in the PDF?
<img src="[...]/workspace/public/uploads/images/slideuri/home-2-4e8f3bfdbf6cd.jpg" />
I'm getting this error
TCPDF ERROR: [Image] Unable to get image: [...]/extensions/urltopdf/lib/tcpdf/cache/img_e691f07a402ddb3ff1ffd8c517df4206
Nevertheless, bac kground images will not appear:
<div style="background: url([...]/workspace/public/uploads/images/slideuri/home-2-4e8f3bfdbf6cd.jpg);">
<p>Background image from CSS won't start.</p>
</div>
Edit 11:42 GMT:
Found it ... TCPDF tries to write given image in a temp file in it's cache folder [...]/urltopdf/lib/tcpdf/cache. If cache folder is missing (TCPDF assumes it exists), the write operation will fail silently and TCPDF will later throw above error.
To fix this, create cache folder here [...]/urltopdf/lib/tcpdf/cache.
Yep, the other gotcha is to be careful with images from URL's when your server doesn't allow CURL_FOLLOWLOCATION.
Just tried this extension, but due to security reasons my host has set a open_basedir
And they can not change this.
So i get a Symphony Warning
Is this a show stopper or is there a way around this?
It's ugly, but I had to work around the same limitation with the following horrible mess.
- Add this function anywhere in the class
- Remove this line
- Change this line to be
$imgdata = $this->curl_redir_exec($cs);
That worked for me.
It's working now!
thanks
Good to hear!
I would commit the changes, but I would like to keep the tcpdf library fairly unchanged so I can update it as they update it (although I've already stuffed this by removing the fonts folder!).
I'll make a note to let the lead dev know so he can look at incorporating these changes.
Sidenote: If anyone ever comes across a better PDF generation library, please let me know :)
Sidenote: If anyone ever comes across a better PDF generation library, please let me know :)
Me too...
I'm pretty fine with this 'hack' for now...
I will keep my eye on better libraries if i come across one, this one is pretty poor indeed.
But for simple pdf's it's pretty good.
Another question: I want to leave out the header and footer in the pdf, can you have partial pdf creation when page type is set to 'pdf'
Edit: Someone recommended me fpdf
Has anyone experience encoding problems with PDF attachments?
I'm generating 2 PDFs one version which is accessed as a PDF page and another which is emailed. In the emailed version euro symbols and em-dashes are showing as £$€. I guess this must be an encoding problem but have tried changing the extension driver to use other encoding (ISO-8859-15 and latin1) and the problem persists. Assuming I've changed it in the right place that is!
Has anyone got any ideas?
Can anyone suggest how I'd update my .htaccess to tell Apache not to append a trailing slash for PDF files?
I have a page which is a PDF but has a URL ..../name/. When you save it from the browser, no filename is suggested. I'd like to be able to add a URL parameter for the file name. E.g. .../file/stuart.pdf so that the browser knows what to call the saved file.
Thanks
Create an account or sign in to comment.
@jeffleader
Looks great, it seems you created the same crm as lewis has. Maybe you can inspire each other to fine tune it into an ensemble? Or do you plan on releasing it as an ensemble once you are happy about it?