KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Arabic pdf #716

Open iRiyada opened this topic on on Feb 28, 2019 - 32 comments

iRiyada commented on Feb 28, 2019

Is it possible to generate pdf with arabic fonts using your pdf package?

KoolReport commented on Mar 1, 2019

Yes, it is possible. Have you tried it?

iRiyada commented on Mar 3, 2019

I tried with datatables built in pdf export. It does'nt support arabic fonts. Now I have been trying with koolreport. But 'Could not execute phantomjs error' is coming. Have been going through your forum dealing with this error. Nothing seems to help in my case. I am using windows 10, xampp and laravel

KoolReport commented on Mar 4, 2019

Normally, "Could not execute phantomjs" happens when phantomjs does not have permission to run. In some system, it requires to do full installation ( not just copy like we do, although the suggestion from phantomjs is that we only need to copy the execution file). That's our experience from helping other customers to make phantomjs work. Alternative solution is that you may try our cloudexport package. We create the CloudExport as backup for those find installation of phantomjs impossible ( like in shared host). You may try to see how.

iRiyada commented on Mar 4, 2019

I have given full control to that folder.

iRiyada commented on Mar 4, 2019

still getting blank docs

KoolReport commented on Mar 4, 2019

you set permission for the execution file. Although the folder can be full control, if the file does not have permission to execute, you get blank page as well.

iRiyada commented on Mar 4, 2019

whatever is in the head setion is getting output.But not body

KoolReport commented on Mar 4, 2019

Can you let me know:

  1. Do you get the "Could not execute phantomjs" any more?
  2. Does your pdf file have 0 byte in size?
  3. You use the toBrowser() or saveAs() method to deliver pdf.
iRiyada commented on Mar 4, 2019
  1. I don't get that error any more. I think it had to do with my file name(file name had hyphen in it)
  2. Presently I am trying to run this simple html :

<html>
<head>
hello
</head>
    <body>
        This is my first export using Chromeheadless.io
        <p>Chromeheadless.io save your time and resources in exporting html, report to PDF.</p>
    </body>
</html>

--and I am getting a pdf with just 'hello' from <head>section. file size is 7 bytes

3)I am using toBrowser() method.


iRiyada commented on Mar 5, 2019

In the output, I get only 'hello' from <head> section.

KoolReport commented on Mar 5, 2019

Are you using Export package or CloudExport?

If you have your output like this, it works, let try:

<html>
<head>
</head>
    <body>
        This is my first export using Chromeheadless.io
        <p>Chromeheadless.io save your time and resources in exporting html, report to PDF.</p>
    </body>
</html>

Putting text into head is not correct, so just remove it. Does it work?

iRiyada commented on Mar 5, 2019

I am using Export Package. Only the text inside<head> is displayed. If I remove it, I get blank pdf of 2kb size

KoolReport commented on Mar 5, 2019

Very strange. May I see your full tested code.

iRiyada commented on Mar 6, 2019

CsvReport.php

<?php
namespace App\Reports;


class CsvReport extends \koolreport\KoolReport
{
    use \koolreport\laravel\Friendship;
    use \koolreport\export\Exportable;

   
    public function settings()
    {
        return array(
            "dataSources" => array(
                "mysql" => array(
                    'host' => 'localhost',
                    'username' => 'myTask360',
                    'password' => '123',
                    'dbname' => 'mytask360',
                    'charset' => 'utf8',
                    'class' => "\koolreport\datasources\MySQLDataSource",
                    'modes'  => ['IGNORE_SPACE',
                    'STRICT_TRANS_TABLES',
                    'NO_ZERO_IN_DATE',
                    'NO_ZERO_DATE',
                    'ERROR_FOR_DIVISION_BY_ZERO',
                    'NO_AUTO_CREATE_USER',
                    'NO_ENGINE_SUBSTITUTION'
                        
                        ],
                        
                ),
                "assets"=>array(
                    "path"=>public_path(),
                    "url"=>""
                )
            )
        );

    }

    function setup()
    {

      
            
            $this->src('mysql')
            ->query("SELECT supervision_name,project_name,task_name,owner_name,assignee_name,status_name,creation_date,due_Date,completion_percent,task_duration_wd,end_in_wd,delay_wd,missing_due_date FROM v_tasks_delayed")
            ->pipe($this->dataStore('user_details'));
            
           
    }




}
iRiyada commented on Mar 6, 2019

CSVReportController.php

<?php

namespace App\Http\Controllers;

use App\Reports\CsvReport;
use \koolreport\export\Exportable;

class CsvReportController extends Controller
{
    public function __construct()
    {
        $this->middleware("guest");
    }
    public function index()
    {
        $report = new CsvReport;
        $report->run()->export('CsvReportPDF')
        ->settings(array(
            "useLocalTempFolder"=>true,
            "phantomjs"=>"C:/xampp/htdocs/laravelKoolDelayed/vendor/koolphp/koolreport/packages/export/bin/phantomjs",
            "resourceWaiting"=>2000,
        ))
        ->pdf(array(
            "format"=>"A4",
            "orientation"=>"portrait",
            //"zoom"=>2,
            "margin"=>"1in"
        ))
        ->toBrowser("orders.pdf");
 
    }
}
iRiyada commented on Mar 6, 2019

CSVReportPDF.php

for a trial lets get this running first.

<html>
     
         <head>
           
        </head>
        <body>
        hi
    
        This is my first export using Chromeheadless.io
        <p>Chromeheadless.io save your time and resources in exporting html, report to PDF.</p>
         </body>
</html>
iRiyada commented on Mar 6, 2019

I am using laravel 5.7. in windows 10 Apache Server as localhost

iRiyada commented on Mar 6, 2019

Are you able to fnd the issue?

KoolReport commented on Mar 7, 2019

We test but it works. One question: Does our export example in our examples suite work?

iRiyada commented on Mar 7, 2019

I have'nt checked with that..Will check with that

KoolReport commented on Mar 9, 2019

Oh! I've looked at your code and I see this:

"phantomjs"=>"C:/xampp/htdocs/laravelKoolDelayed/vendor/koolphp/koolreport/packages/export/bin/phantomjs",

The file should have "exe" extension in windows. Let try:

"phantomjs"=>"C:/xampp/htdocs/laravelKoolDelayed/vendor/koolphp/koolreport/packages/export/bin/phantomjs.exe",

and by the way, you may not need to set this as Export package will try to locate the file in bin.

iRiyada commented on Mar 17, 2019

1)After adding "phantomjs"=>"C:/xampp/htdocs/laravelKoolDelayed/vendor/koolphp/koolreport/packages/export/bin/phantomjs.exe",

2) tried removing the setting, no change in output- only empty pdf appears

iRiyada commented on Mar 18, 2019

I tried with your example. Still it is rendering only empty page.

KoolReport commented on Mar 18, 2019

So will be the phantomjs could not run. What is your Window version? If you try to run the phantomjs like this using command line:

phantomjs --version

does it work?

iRiyada commented on Mar 18, 2019

when I enter that comment

phantomjs --version

Suggestion [3,General]: The command phantomjs was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\phantomjs". See "get-help about_Command_Precedence" for more details. PS C:\xampp\htdocs\delayedReportTrial\vendor\koolphp\koolreport\packages\export\bin>

KoolReport commented on Mar 18, 2019

So if you type ".\phantomjs" does it work?

iRiyada commented on Mar 18, 2019

Nope. A phantomjs promptt appears like this

       phantomjs>              
phantomjs> phantomjs --version

Gives this Error-"Expected an identifier but found 'version' instead "

KoolReport commented on Mar 18, 2019

It seems phantomjs is running. It seems to me that the phantomjs could not run because of security. Could you please check the permission of the "phantomjs.exe" file.

iRiyada commented on Apr 18, 2019

It did'nt run in the client. but somehow it is running in the server. Thankyou.

iRiyada commented on Apr 22, 2019

It is running in the server. So we generated a full domain name instead of the localhost andnow it is running in the client as well. Thank you for the support.

Balamurugan commented on Feb 2, 2022

Hi i tried to generate a arabic report its showing junk characters , english its working fine. In database its arabic only. can you pls suggest a solution for this

Sebastian Morales commented on Feb 7, 2022

Hi, were you using Export or CloudExport package? And did you include the following meta tag in your PDF view:

<meta charset="UTF-8">
...

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None