- Posts: 19
COMMUNITY FORUM
pdf extension for k2 items
- Nilesh Toshniwal
-
Topic Author
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- Marcos Peebles
-
- Offline
- New Member
- Posts: 5
Any news on this? have you been able to make it? Thx
Marcos
Please Log in or Create an account to join the conversation.
- Nilesh Toshniwal
-
Topic Author
- Offline
- New Member
- Posts: 19
I tried but couldn't give much time to it, though I got basic pdf ready, but need to embed enhanced features like showing author, category, creation date or modified date of item etc etc basically if I say it technically the parameters you set for item view options, as I got busy with some other stuff on my projects so cant manage to give it a try, but posting my development here and brief instructions, so if others developers can contribute to it.
1. place the attached view.pdf.php file to components/com_k2/views/item folder
2. add a piece of code as in attached txt file to your item template (the template you are using for k2) like I used default template which comes with k2 (for mine the path was components/com_k2/templates/default/item.php )
Please note: this is very basic code and I don't suggest it to use it on any live environment, and i edited core template file while you can use template override for the same. (just done to save my time :) item-template-code.txt)
Please Log in or Create an account to join the conversation.
- Nilesh Toshniwal
-
Topic Author
- Offline
- New Member
- Posts: 19
1. To show Author name in pdf
2. To show created date and time and last modified date and time in pdf file.
Please Log in or Create an account to join the conversation.
- Nilesh Toshniwal
-
Topic Author
- Offline
- New Member
- Posts: 19
Please Log in or Create an account to join the conversation.
- Marcos Peebles
-
- Offline
- New Member
- Posts: 5
Marcos
Please Log in or Create an account to join the conversation.
- Nilesh Toshniwal
-
Topic Author
- Offline
- New Member
- Posts: 19
Marcos Peebles said:Awesome Nilesh, gonna test this, thx for your efforts and work! Marcos
Please Log in or Create an account to join the conversation.
- Ruth Cheesley
-
- Offline
- Senior Member
Good start, I can't believe it's not a core part of K2 to be honest!
Ruth
Ruth Cheesley
Virya Technologies
Please Log in or Create an account to join the conversation.
- Nilesh Toshniwal
-
Topic Author
- Offline
- New Member
- Posts: 19
Thx for all your feedback, but this is not a problem with this code, this is actually all because joomla still uses very old tcpdf library, if you dont have your site live, you can give a try like, download the latest tcpdf library from www.tcpdf.org and extract it and then go to /libraries and replace the tcpdf folder there with your downloaded one and try generating pdf then
Another thing I found with joomla is it has hard coded image scaling to 25% in file libraries/joomla/document/pdf/pdf.php line no. 41, set scale as 4 if you change that to 1 you will get original image size else your image size will be 25% of its displaying on browser.
I am still trying if can do something without replacing or making core hacks and will surely give more tries soon. :)
Ruth Cheesley said:This looks great, I've got it working but it's not showing tables properly so may have to have a twiddle, also not showing the image. Good start, I can't believe it's not a core part of K2 to be honest!
Ruth
Please Log in or Create an account to join the conversation.
- dani_imanima
-
- Offline
- New Member
- Posts: 10
it's possible?
Please Log in or Create an account to join the conversation.
- Nilesh Toshniwal
-
Topic Author
- Offline
- New Member
- Posts: 19
dani_imanima said:I want show the extrafield in pdf, it's possible?
Please Log in or Create an account to join the conversation.
- dani_imanima
-
- Offline
- New Member
- Posts: 10
you know some method?
Please Log in or Create an account to join the conversation.
- dani_imanima
-
- Offline
- New Member
- Posts: 10
Please Log in or Create an account to join the conversation.
- Nilesh Toshniwal
-
Topic Author
- Offline
- New Member
- Posts: 19
dani_imanima said:can you help me?
Please Log in or Create an account to join the conversation.
- dani_imanima
-
- Offline
- New Member
- Posts: 10
Please Log in or Create an account to join the conversation.
- Nilesh Toshniwal
-
Topic Author
- Offline
- New Member
- Posts: 19
try attached file, but I am still struggling with getting item parameters if they are set to "inherit from category". but this file will show extra fields for you and wont show anything of extra fields if they are not set.
Please Log in or Create an account to join the conversation.
- dani_imanima
-
- Offline
- New Member
- Posts: 10
hello!!!
thank you very much!!!!
Please Log in or Create an account to join the conversation.
- dani_imanima
-
- Offline
- New Member
- Posts: 10
Please Log in or Create an account to join the conversation.
- rawling
-
- Offline
- Junior Member
- Posts: 23
Please Log in or Create an account to join the conversation.
- dani_imanima
-
- Offline
- New Member
- Posts: 10
Please Log in or Create an account to join the conversation.