VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: ShafanHameed on May 07, 2021, 23:09:54 PM

Title: Product Detail Pdf
Post by: ShafanHameed on May 07, 2021, 23:09:54 PM
Hi,
I am developing  website for my client using Virtuemart but i am stuck in one thing. How to design/re-design pdf layout that shows us product details ? I found out that it should be default_pdf.php file and if i type any text in it it shows but when i try to add any html or bootstrap class/ids/codes it do nothing. I am using VirtueMart Version 3.8.8 .

so to make the question simple.
How can i design/code virtuemart product details pdf file ?

Any help would be wonderful.
Thanks in advance
Title: Re: Product Detail Pdf
Post by: Jörgen on May 08, 2021, 11:52:48 AM
TCPDF does not accept any complicated CSS or HTML. Please google what TCPDF can handle.

Jörgen @ Kreativ Fotografi
Title: Re: Product Detail Pdf
Post by: ShafanHameed on May 08, 2021, 12:18:25 PM
Oh ok. and if i found a solution to style and grid based layout design then on which file should i have to implement it ?
Title: Re: Product Detail Pdf
Post by: jenkinhill on May 08, 2021, 13:56:52 PM
Would this help?  https://www.phoca.cz/phocapdf
Title: Re: Product Detail Pdf
Post by: ShafanHameed on May 08, 2021, 22:18:21 PM
Hi,
I have installed Phoca PDF plugin but after that pdf system crashed i think. Attaching screenshot with it. Its not loading the pdf file anymore. Even after disabling this plugin i am still getting this error. Any idea whats causing this and how to fix this ?
Title: Re: Product Detail Pdf
Post by: Jörgen on May 09, 2021, 08:10:38 AM
Contact Phoca support perhaps ?
Title: Re: Product Detail Pdf
Post by: ShafanHameed on May 21, 2021, 12:08:44 PM
Ok. Thank you for your guidance and help. Really appreciated
Title: Re: Product Detail Pdf
Post by: pinochico on May 21, 2021, 12:31:31 PM
Yes, it is crashed, because Max take original phoca pdf solution (it is open source, isn't it? :), rename headers as virtuemart developped without cooperation with Jan, but use the same path as for phoca pdf libraries.

You have to contact phoca support (Jan - we talked about this yesterday), but I have no idea if you are find right solutions :)

Maybe delete VM TCPDF before instalation Phoca PDF.

Good luck!
Title: Re: Product Detail Pdf
Post by: Studio 42 on May 21, 2021, 13:43:38 PM
Quote from: pinochico on May 21, 2021, 12:31:31 PM
Yes, it is crashed, because Max take original phoca pdf solution (it is open source, isn't it? :), rename headers as virtuemart developped without cooperation with Jan, but use the same path as for phoca pdf libraries.
Since what year ?
PDf support was added at begin of Vm1.9 by me and we never used phoca code for this
Title: Re: Product Detail Pdf
Post by: pinochico on May 21, 2021, 14:39:41 PM
I don't know exactly for which version, I have only info from Phoca (Jan) by Joomla Cafe Day (every week we are talked on chat about future Joomla nad ecommerce in Czech republic)

- are the same files (with grafic and fonts), only header rewrited and use the same paths for libraries == after instal pdf is crashed

I will to check on week and check with VM 1.9 and EasyVM 1.9 too.
Title: Re: Product Detail Pdf
Post by: ShafanHameed on May 22, 2021, 00:58:50 AM
The problem still remains the same. I tried to contact PhocaPDF team and they told me that the current version is outdated and not being updated long ago. And i should try Phoca Cart instead of VM. What i am asking. Is there any solution if a pdf system is crashed due to trying to install PhocaPDF. What should we do to make things work properly. And is there any solution VM has to offer either Free or Premium so that users can Style PDF files to the way they want or atlest pdf generated results can be modified ?

Providing this opportunity in shape of a plugin and/or an extended extension should be a good idea. No one wanted to follow the old pattern of PDF generated files unless they are going to use the boring styles of templating which comes with pre-installed packages. Now a days almost every person like to design their own website according to their needs one way or another.

If there is any solution that this issue can be fixed then please share the solution and also if any alternatives to self generated pdf files so VM users can design according to their needs will also be appreciated.

Thanks in Advance
Title: Re: Product Detail Pdf
Post by: pinochico on May 22, 2021, 09:38:48 AM
We use pdf system for tickets or gift card from customized death app RD-e Tickets too.

So every pdf system it must be very simple, because you can't render every html element.

Then right question is other - need final customers really any pdf system?
Use pdf system  amazon for customer?

I don't think so.

But if you need, try others pdf system - from RSForm PRO
Title: Re: Product Detail Pdf
Post by: ShafanHameed on May 22, 2021, 21:59:48 PM
Means there isnt any proper solution of it. Also kindly let me know that my pdf system is not working after the installation of PhocaPDF how can i revert it to working condition as it was in the initial state.
Title: Re: Product Detail Pdf
Post by: Jörgen on May 22, 2021, 22:34:08 PM
Delete all occurencies of Phoca PDF and install the VM TCPDF again.

Jörgen
Title: Re: Product Detail Pdf
Post by: pinochico on May 23, 2021, 08:18:33 AM
QuoteMeans there isnt any proper solution of it.

I am not saying that there is no right solution.
You have to search and test.
I will not do that for you.

But since I don't need your needs for product detail in PDF - as I wrote - the customer doesn't need this information in PDF (creating a product catalog in PDF using a PDF library is not the right idea - you generate problems unnecessarily), I'm not even looking for a final solution.
Anyway, from the experience with other systems and from the information on how PDF generation works, I know that it is not easy to create a PDF from a full HTML page.
That's why I won't even try.
Title: Re: Product Detail Pdf
Post by: GJC Web Design on May 23, 2021, 15:51:09 PM
why not just over ride the components\com_virtuemart\views\productdetails\tmpl\default_pdf.php

add inline css changes etc ...  TCPDF is never going to display css libraries like bootstrap etc correctly ...  really think your making a mountain ot of a molehill here...

TCPDF understands basic inline css and html tags .. plenty of documentation at the TCPDF site

I regularly make pretty complex pdf layouts using this technique 
Title: Re: Product Detail Pdf
Post by: Studio 42 on May 24, 2021, 10:10:19 AM
If you have a render error, then you have missing tags in the HTML or a PHP error.
To check the PHP errors, you can search in your PHP error.log
Title: Re: Product Detail Pdf
Post by: ShafanHameed on May 24, 2021, 13:28:54 PM
Thanks everyone.. i will try to override default_pdf.php and will share the details here..