Problem with generating pdf (font)

  • Posts: 53
  • Thank you received: 2
  • Hikamarket Multivendor Hikaserial Standard Hikashop Business
11 months 5 days ago #274117

-- HikaShop version -- : 3.1.1
-- HikaSerial version -- : 2.0.0
-- Joomla version -- : 3.7.3
-- PHP version -- : 5.6.31
-- Browser(s) name and version -- : Firefox

Hi, i just updated Hikaserial.

Tried to generate a pdf as attachment (selling a voucher).
The checkout works. Creating vouchers as PNG work.
But problem with creating a PDF:

When changing the ORDER to "shipped" or "confirmed" in the administration I get this error message:

Warning: opendir(/home/.sites/104/site1948644/web/2017-05/media/com_hikaserial/fonts/tcpdf/): failed to open dir: No such file or directory in /home/.sites/104/site1948644/web/2017-05/administrator/components/com_hikaserial/inc/tcpdf/tcpdf.php on line 1945 TCPDF ERROR: Could not include font definition file: helvetica

Same when changing the font or template for pdf creation.
The folder and the file is there.
Does not create a PDF and does not send it to the customer.

What can I do?

Please Log in or Create an account to join the conversation.

  • Posts: 111
  • Thank you received: 1
11 months 5 days ago #274125

Hi,

I have exactly the same problem:

Warning: opendir(/home/public_html/media/com_hikaserial/fonts/tcpdf/): failed to open dir: No such file or directory in /home/public_html/administrator/components/com_hikaserial/inc/tcpdf/tcpdf.php on line 1945
TCPDF ERROR: Could not include font definition file: helvetica

It does not make a difference the font I choose, always same error.

Thanks

Last Edit: 11 months 5 days ago by sabroso.

Please Log in or Create an account to join the conversation.

  • Posts: 22431
  • Thank you received: 3487
  • MODERATOR
11 months 5 days ago #274118

Hello,

Please re-download the HikaSerial package ; there was a missing line in the Joomla XML so the "fonts" folder wasn't copied correctly.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 111
  • Thank you received: 1
11 months 5 days ago #274140

re-downloaded and re-installed.

If I select arial as the font in the plugin config I get:
TCPDF ERROR: Could not include font definition file: arial

if I select any other font in the plugin config I get:
Fatal error: Call to undefined method TCPDF::GDImage() in /home/tangopol/public_html/mg/plugins/hikaserial/pdfserial/pdfserial.php on line 538

Last Edit: 11 months 5 days ago by sabroso. Reason: further troubleshooting

Please Log in or Create an account to join the conversation.

  • Posts: 22431
  • Thank you received: 3487
  • MODERATOR
11 months 5 days ago #274143

Hello,

Oh yes, that's right that I added that patch into FPDF in order to handle GD images from the memory (without having to store it into a temporally file in the server).
Instead of patching TCPdf with the same kind of patch, I added a new HikaSerial Inc and updated the PDFSerial in order to have a new stream protocol.
As long as your QRcode and Barcodes images are not too heavy, it should work properly.
And for product image, because they are already in the server it's not an issue.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 111
  • Thank you received: 1
11 months 5 days ago #274144

Well, the QR code is breaking the execution, even if I make it of size 1px...and the Arial font type does NOT work....

NO QR code = completely useless plugin

Very disappointing :(

Please Log in or Create an account to join the conversation.

  • Posts: 22431
  • Thank you received: 3487
  • MODERATOR
11 months 5 days ago #274145

Hello,

What do you mean breaking the execution ?
I can see to use the QRcode generation within the PDF lib if it's necessary but the standard QRcode lib should work too.
Afterwards, with the fact that PDF can have a higher definition, maybe some adjustments are required.
When I first implemented the plugin it was with with FPDF and after a while I saw that the support of UTF8 was not really good ; so I integrated TCPDF and because the two libs are using the same base and the same API ; I tough that it will work the same.
But unfortunately, I'm not a specialist with these PDF libs ; that's why feedback and ideas are welcome !

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 53
  • Thank you received: 2
  • Hikamarket Multivendor Hikaserial Standard Hikashop Business
11 months 5 days ago #274170

Hi,

I re-installed the latest version from today.

Now I have a new and very strange problem:

When changing the ORDER to "confirmed" I do not get the error message anymore.
An pdf is opened automatically in a browser window with the name "index.php-1.pdf",
when trying it a second time there is a pdf named "index.php-2.pdf"... and so on.



This pdf has 10 pages with some information in it, but of course it does not look as the voucher should look like.

No email with the PDF voucher is sent to the customer.

With QR Code or not, changing pdf template.... - always the same problem.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 22431
  • Thank you received: 3487
  • MODERATOR
11 months 5 days ago #274175

Hello,

Please provide details about your PDF Serial configuration and also indicate which PDF lib you're using.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 53
  • Thank you received: 2
  • Hikamarket Multivendor Hikaserial Standard Hikashop Business
11 months 4 days ago #274190

Hi,

I tried with TCPDF and with FPDF as possible in the serial setting area.
... but with same result.
Always an automatic download (pdf opens in a window) instead of sending the pdf to the customers email.

Serial settings:



???
thank you

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 22431
  • Thank you received: 3487
  • MODERATOR
11 months 4 days ago #274203

Hello,

I was not able to reproduce your issue in local but I think I saw what was the source of the issue.
So I have changed how are made the "Output" calls to the PDF libraries in order to retrieve the binary content and avoid possible buffer issue when using PHP "ob_start / ob_end".

I also made some modifications when using TCPDF so it can use directly the Barcode/QRcode features of the lib instead of generating an image.
It looks like the generated image need to be scaled'up and the resolution is not processed correctly which made the QRcode blurry.
I made few tests and I got a clean code (even if I could see very thin blank lines but it might be related to the PDF viewer).

Just for the information, I used that test config, with TCPDF :
pasteboard.co/GBvRLr9.png

Afterwards, I still need to perform some checks around the fonts, the two libs might not have the same available font list and I need to find a way to handle that in the Plugin.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 53
  • Thank you received: 2
  • Hikamarket Multivendor Hikaserial Standard Hikashop Business
11 months 4 days ago #274212

Hello,

okay, I am gonna wait.

Let me know if I can help somehow, if you need ftp or admin access...

regards

Please Log in or Create an account to join the conversation.

  • Posts: 22431
  • Thank you received: 3487
  • MODERATOR
11 months 4 days ago #274213

Hello,

The packages are online.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 53
  • Thank you received: 2
  • Hikamarket Multivendor Hikaserial Standard Hikashop Business
11 months 3 days ago #274265

Hi,

unfortunately it does not work.

The automatic PDF download ist gone - but now I get this error message in a lightbox:

Fatal error: Call to undefined method plgHikaserialPdfserial::getMime() in /home/.sites/104/site1948644/web/2017-05/plugins/hikaserial/pdfserial/pdfserial.php on line 294


Confirmations are send but no Email with the pdf voucher is send.
Same result with FPDF and TCPDF

Please Log in or Create an account to join the conversation.

  • Posts: 22431
  • Thank you received: 3487
  • MODERATOR
11 months 3 days ago #274267

Hello,

I removed the usage of getMime and force its value to "application/pdf".

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 53
  • Thank you received: 2
  • Hikamarket Multivendor Hikaserial Standard Hikashop Business
11 months 2 days ago #274347

Hi,

thank you, now a pdf is made and send to the customer.

But the file is named like "pdf5970a3263779f." without any ".pdf" file extension.
So it is like an unknown or dangerous file.

1. Please add the .pdf file extensions

2. I would like to use a background image or the template possibility for more beautiful pdfs. There is no documentation for using the pdf serial plugin yet or did I miss it?


thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 22431
  • Thank you received: 3487
  • MODERATOR
11 months 2 days ago #274350

Hello,

Good to know that the plugin is working better.
I have changed the extensions ; the system was based on the same way that "attachserial" and using a dynamic extension system depending rules, but while in attach serial you can't use a template, with that plugin it's possible.

2 - There is no documentation right now ; but the documentation for the "attach serial" plugin is the base. The two plugins are almost the same except that they a different kind of file.
If you provide a PDF file as the template, it will be used as a template ( www.hikashop.com/forum/17-serial-how-to/...f-plugin.html#274069 )
Otherwise, the PDF lib could have related features and depending the feedback, some could be implemented into the plugin.
Like : tcpdf.org/examples/example_051/

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.130 seconds
Powered by Kunena Forum