Forums: PDF Issues - PDF View Button Disappears - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

PDF Issues - PDF View Button Disappears 3 PDF Creation Issues - Sorry if these are Noob related Rate Topic: -----

#1 User is offline   GreyGoat 

  • Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: 16-June 16

Posted 06 December 2017 - 09:52 PM

Apologies in advance if the following are real noob questions...

I have an application built with PHPR 9.8 here: http://demo.asprunne...uk/hsp_lite_0_4
U: admin
P: admin

Customers have Contracts and there are Invoices and Visits associated with each Contract. Visits also have Appointment Letters.

I am trying to view Letters and Invoices as PDFs so that they can be printed and saved from the application (the client does not want to do Word mail merges).

I can open list pages for Customer Letters and Customer Invoices from the top-level menu and if I then view a letter or an invoice from either of these lists there is a PDF View button presented at the top of the page.

** Issue 1 - PDFs for Customer Letters are created OK, but for Invoices the PDF Build never completes.

There are also copies of the above list pages when you expand a Customer list record.

** Issue 2 - The View pages for Customer Letters and Customer Invoices do not show any PDF View buttons.

If you expand a Contract record and open the Visit tab, you will see a button labelled "PDF" at the end of each visit record. This is because PDF View buttons were not appearing for the Appointment Letter views under expanded Visit records and I was attempting a work around with Dompdf.

The test On Server code within these buttons is very basic and was taken from a Dompdf site and is as follows:
require_once 'plugins/dompdf/include/autoload.inc.php';
// reference the Dompdf namespace
use Dompdf\Dompdf;

// instantiate and use the dompdf class
$dompdf = new Dompdf();
$dompdf->loadHtml('<h1>DOMPDF Demo</h1><br><p>Hello World !</p>');

// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'portrait');

// Render the HTML as PDF
$dompdf->render();

// Output the generated PDF to Browser
$dompdf->stream();


** Issue 3 - I get "Parse error: syntax error, unexpected 'use' (T_USE) in C:\UserAccounts\www\accounts_azpire_co_uk\hsp_lite_0_4_20171206043246\buttonhandler.php on line 77".

These issues are causing dents in my desk because I've been running around in ever decreasing cirles, so any advice would be very much appreciated.

Many, many thanks.

Kelvin

PS - The PHPR Invoice template is great, but it won't address my need for all of the types of output my client requires.
Cheers.
0

#2 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15553
  • Joined: 03-February 03

Posted 07 December 2017 - 12:02 AM

Check this:
https://stackoverflo...inside-function

"use" keyword should be outside of any functions. You cannot use it in button's server code. Use built-in PDF export functionality.
Best regards,
Sergey Kornilov
0

#3 User is offline   GreyGoat 

  • Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: 16-June 16

Posted 07 December 2017 - 09:25 AM

View Postadmin, on 07 December 2017 - 12:02 AM, said:

Check this:
https://stackoverflo...inside-function

"use" keyword should be outside of any functions. You cannot use it in button's server code. Use built-in PDF export functionality.


OK - thanks. That reply addresses Issue 3.

Unfortunately, issue 3 arose because of Issue 2 - the disappearance of PDF View buttons from any list pages that are not accessed directly from the top-level menu. This is important because the client needs to view those letters and invoices directly associated with visits (appointments) and contracts rather than having to trawl through all of the documents ever produced by the application.

And Issue 1 is still outstanding and this uses the built-in PDF export functionality!
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic