Magento 2 Fatal error: Uncaught Error: Class not foundI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Reset Password Problem : Magento 2Not able to add/update magento2 category post upgrade from 1.9 to 2.1.0Trying to uninstall module“Class mixed does not exist” with only one array param in the body in Magento 2Add configure product in Cart using Magento 2 API facing an issuePHP fatal error: Uncaught TypeError: Argument 2 passed to MagentoCatalogPluginBlockTopmenuMagento error when going to forgotten password link

How do anti-virus programs start at Windows boot?

Can hydraulic brake levers get hot when brakes overheat?

Font with correct density?

Good allowance savings plan?

Life insurance that covers only simultaneous/dual deaths

Professor being mistaken for a grad student

RegionDifference for Cylinder and Cuboid

Old race car problem/puzzle

Did CPM support custom hardware using device drivers?

My story is written in English, but is set in my home country. What language should I use for the dialogue?

Humanity loses the vast majority of its technology, information, and population in the year 2122. How long does it take to rebuild itself?

How is the Swiss post e-voting system supposed to work, and how was it wrong?

How could a female member of a species produce eggs unto death?

Instead of Universal Basic Income, why not Universal Basic NEEDS?

How do I hide Chekhov's Gun?

How could a scammer know the apps on my phone / iTunes account?

Meaning of "SEVERA INDEOVI VAS" from 3rd Century slab

Is it normal that my co-workers at a fitness company criticize my food choices?

Why are there 40 737 Max planes in flight when they have been grounded as not airworthy?

Do I need life insurance if I can cover my own funeral costs?

Why did it take so long to abandon sail after steamships were demonstrated?

Co-worker team leader wants to inject his friend's awful software into our development. What should I say to our common boss?

Does the statement `int val = (++i > ++j) ? ++i : ++j;` invoke undefined behavior?

Where is the 1/8 CR apprentice in Volo's Guide to Monsters?



Magento 2 Fatal error: Uncaught Error: Class not found


I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Reset Password Problem : Magento 2Not able to add/update magento2 category post upgrade from 1.9 to 2.1.0Trying to uninstall module“Class mixed does not exist” with only one array param in the body in Magento 2Add configure product in Cart using Magento 2 API facing an issuePHP fatal error: Uncaught TypeError: Argument 2 passed to MagentoCatalogPluginBlockTopmenuMagento error when going to forgotten password link













1















I am using one custom php library in magento 2 to convert html to pdf. Here is the code that i am using.



<?php

namespace CompanyModuleControllerAdminhtmlQuote;

use MagentoFrameworkAppActionAction;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppFilesystemDirectoryList as DirectoryList;

use CompanyModuleHelperPdfCrowd;

class QuotePdf extends Action

/**
* @var MagentoFrameworkAppResponseHttpFileFactory
*/
protected $fileFactory;
protected $_mediaDirectory;
protected $directory_list;

protected $dompdfFactory;
protected $layoutFactory;

protected $authSession;
//protected $quote_info;
protected $userFactory;

public function __construct(
Context $context,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkFilesystem $filesystem,
MagentoBackendModelAuthSession $authSession,
DirectoryList $directory_list,
MagentoUserModelUserFactory $userFactory
)
parent::__construct($context);
$this->fileFactory = $fileFactory;
$this->authSession = $authSession;
$this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$this->directory_list = $directory_list;
$this->userFactory = $userFactory;


public function execute()

if($this->authSession->isLoggedIn())

$id = $this->getRequest()->getParam('id');

$client = new Pdfcrowd("MYUSERNAME", "xxxxxxx-KEY");

// set HTTP response headers
$pdf = $client->convertHtml($this->getHtmlForPdf($id));

header("Content-Type: application/pdf");
header("Cache-Control: no-cache");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=commercialsale-".$id.".pdf");

echo $pdf;





Here is my Helpler file



<?php

namespace CompanyModuleHelper;

class PdfCrowd
//
// Pdfcrowd constructor.
//
// $username - your username at Pdfcrowd
// $apikey - your API key
// $hostname - API hostname, defaults to pdfcrowd.com
//
function __construct($username, $apikey, $hostname=null)
if ($hostname)
$this->hostname = $hostname;
else
$this->hostname = self::$api_host;
$this->useSSL(false);
$this->fields = array(
'username' => $username,
'key' => $apikey,
'pdf_scaling_factor' => 1,
'html_zoom' => 200);
$this->proxy_name = null;
$this->proxy_port = null;
$this->proxy_username = "";
$this->proxy_password = "";

$this->user_agent = "pdfcrowd_php_client_".self::$client_version."_(http://pdfcrowd.com)";


?>


And here is the error that i am getting...




Fatal error: Uncaught Error: Class 'CompanyModuleHelperPdfCrowd'
not found in
/home/patios/public_html/app/code/Company/Module/Controller/Adminhtml/Quote/QuotePdf.php:49
Stack trace: #0
/home/patios/public_html/vendor/magento/framework/App/Action/Action.php(107):
CompanyModuleControllerAdminhtmlQuoteQuotePdf->execute() #1
/home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(58):
MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
2 /home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(138):
CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor->___callParent('dispatch',
Array) 3
/home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(153):
CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
4 /home/patios/public_html/generated/code/Company/Module/Controller/Adminhtml
in
/home/patios/public_html/app/code/Company/Module/Controller/Adminhtml/Quote/QuotePdf.php
on line 49




Note:
Same code is working on my local and not on live server.










share|improve this question
















bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 2





    Check exact folder and class name for CompanyModuleHelperPdfCrowd

    – Sohel Rana
    Jun 8 '18 at 13:41











  • Thanks to pointing me. Sorry actually there is capital word issue in my file name. Strange that this is working in my local.

    – Hardik
    Jun 8 '18 at 13:53











  • yes, Linux is naming strict type. But other system like windows, mac not.

    – Sohel Rana
    Jun 8 '18 at 13:55















1















I am using one custom php library in magento 2 to convert html to pdf. Here is the code that i am using.



<?php

namespace CompanyModuleControllerAdminhtmlQuote;

use MagentoFrameworkAppActionAction;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppFilesystemDirectoryList as DirectoryList;

use CompanyModuleHelperPdfCrowd;

class QuotePdf extends Action

/**
* @var MagentoFrameworkAppResponseHttpFileFactory
*/
protected $fileFactory;
protected $_mediaDirectory;
protected $directory_list;

protected $dompdfFactory;
protected $layoutFactory;

protected $authSession;
//protected $quote_info;
protected $userFactory;

public function __construct(
Context $context,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkFilesystem $filesystem,
MagentoBackendModelAuthSession $authSession,
DirectoryList $directory_list,
MagentoUserModelUserFactory $userFactory
)
parent::__construct($context);
$this->fileFactory = $fileFactory;
$this->authSession = $authSession;
$this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$this->directory_list = $directory_list;
$this->userFactory = $userFactory;


public function execute()

if($this->authSession->isLoggedIn())

$id = $this->getRequest()->getParam('id');

$client = new Pdfcrowd("MYUSERNAME", "xxxxxxx-KEY");

// set HTTP response headers
$pdf = $client->convertHtml($this->getHtmlForPdf($id));

header("Content-Type: application/pdf");
header("Cache-Control: no-cache");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=commercialsale-".$id.".pdf");

echo $pdf;





Here is my Helpler file



<?php

namespace CompanyModuleHelper;

class PdfCrowd
//
// Pdfcrowd constructor.
//
// $username - your username at Pdfcrowd
// $apikey - your API key
// $hostname - API hostname, defaults to pdfcrowd.com
//
function __construct($username, $apikey, $hostname=null)
if ($hostname)
$this->hostname = $hostname;
else
$this->hostname = self::$api_host;
$this->useSSL(false);
$this->fields = array(
'username' => $username,
'key' => $apikey,
'pdf_scaling_factor' => 1,
'html_zoom' => 200);
$this->proxy_name = null;
$this->proxy_port = null;
$this->proxy_username = "";
$this->proxy_password = "";

$this->user_agent = "pdfcrowd_php_client_".self::$client_version."_(http://pdfcrowd.com)";


?>


And here is the error that i am getting...




Fatal error: Uncaught Error: Class 'CompanyModuleHelperPdfCrowd'
not found in
/home/patios/public_html/app/code/Company/Module/Controller/Adminhtml/Quote/QuotePdf.php:49
Stack trace: #0
/home/patios/public_html/vendor/magento/framework/App/Action/Action.php(107):
CompanyModuleControllerAdminhtmlQuoteQuotePdf->execute() #1
/home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(58):
MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
2 /home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(138):
CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor->___callParent('dispatch',
Array) 3
/home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(153):
CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
4 /home/patios/public_html/generated/code/Company/Module/Controller/Adminhtml
in
/home/patios/public_html/app/code/Company/Module/Controller/Adminhtml/Quote/QuotePdf.php
on line 49




Note:
Same code is working on my local and not on live server.










share|improve this question
















bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 2





    Check exact folder and class name for CompanyModuleHelperPdfCrowd

    – Sohel Rana
    Jun 8 '18 at 13:41











  • Thanks to pointing me. Sorry actually there is capital word issue in my file name. Strange that this is working in my local.

    – Hardik
    Jun 8 '18 at 13:53











  • yes, Linux is naming strict type. But other system like windows, mac not.

    – Sohel Rana
    Jun 8 '18 at 13:55













1












1








1








I am using one custom php library in magento 2 to convert html to pdf. Here is the code that i am using.



<?php

namespace CompanyModuleControllerAdminhtmlQuote;

use MagentoFrameworkAppActionAction;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppFilesystemDirectoryList as DirectoryList;

use CompanyModuleHelperPdfCrowd;

class QuotePdf extends Action

/**
* @var MagentoFrameworkAppResponseHttpFileFactory
*/
protected $fileFactory;
protected $_mediaDirectory;
protected $directory_list;

protected $dompdfFactory;
protected $layoutFactory;

protected $authSession;
//protected $quote_info;
protected $userFactory;

public function __construct(
Context $context,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkFilesystem $filesystem,
MagentoBackendModelAuthSession $authSession,
DirectoryList $directory_list,
MagentoUserModelUserFactory $userFactory
)
parent::__construct($context);
$this->fileFactory = $fileFactory;
$this->authSession = $authSession;
$this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$this->directory_list = $directory_list;
$this->userFactory = $userFactory;


public function execute()

if($this->authSession->isLoggedIn())

$id = $this->getRequest()->getParam('id');

$client = new Pdfcrowd("MYUSERNAME", "xxxxxxx-KEY");

// set HTTP response headers
$pdf = $client->convertHtml($this->getHtmlForPdf($id));

header("Content-Type: application/pdf");
header("Cache-Control: no-cache");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=commercialsale-".$id.".pdf");

echo $pdf;





Here is my Helpler file



<?php

namespace CompanyModuleHelper;

class PdfCrowd
//
// Pdfcrowd constructor.
//
// $username - your username at Pdfcrowd
// $apikey - your API key
// $hostname - API hostname, defaults to pdfcrowd.com
//
function __construct($username, $apikey, $hostname=null)
if ($hostname)
$this->hostname = $hostname;
else
$this->hostname = self::$api_host;
$this->useSSL(false);
$this->fields = array(
'username' => $username,
'key' => $apikey,
'pdf_scaling_factor' => 1,
'html_zoom' => 200);
$this->proxy_name = null;
$this->proxy_port = null;
$this->proxy_username = "";
$this->proxy_password = "";

$this->user_agent = "pdfcrowd_php_client_".self::$client_version."_(http://pdfcrowd.com)";


?>


And here is the error that i am getting...




Fatal error: Uncaught Error: Class 'CompanyModuleHelperPdfCrowd'
not found in
/home/patios/public_html/app/code/Company/Module/Controller/Adminhtml/Quote/QuotePdf.php:49
Stack trace: #0
/home/patios/public_html/vendor/magento/framework/App/Action/Action.php(107):
CompanyModuleControllerAdminhtmlQuoteQuotePdf->execute() #1
/home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(58):
MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
2 /home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(138):
CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor->___callParent('dispatch',
Array) 3
/home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(153):
CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
4 /home/patios/public_html/generated/code/Company/Module/Controller/Adminhtml
in
/home/patios/public_html/app/code/Company/Module/Controller/Adminhtml/Quote/QuotePdf.php
on line 49




Note:
Same code is working on my local and not on live server.










share|improve this question
















I am using one custom php library in magento 2 to convert html to pdf. Here is the code that i am using.



<?php

namespace CompanyModuleControllerAdminhtmlQuote;

use MagentoFrameworkAppActionAction;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppFilesystemDirectoryList as DirectoryList;

use CompanyModuleHelperPdfCrowd;

class QuotePdf extends Action

/**
* @var MagentoFrameworkAppResponseHttpFileFactory
*/
protected $fileFactory;
protected $_mediaDirectory;
protected $directory_list;

protected $dompdfFactory;
protected $layoutFactory;

protected $authSession;
//protected $quote_info;
protected $userFactory;

public function __construct(
Context $context,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkFilesystem $filesystem,
MagentoBackendModelAuthSession $authSession,
DirectoryList $directory_list,
MagentoUserModelUserFactory $userFactory
)
parent::__construct($context);
$this->fileFactory = $fileFactory;
$this->authSession = $authSession;
$this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$this->directory_list = $directory_list;
$this->userFactory = $userFactory;


public function execute()

if($this->authSession->isLoggedIn())

$id = $this->getRequest()->getParam('id');

$client = new Pdfcrowd("MYUSERNAME", "xxxxxxx-KEY");

// set HTTP response headers
$pdf = $client->convertHtml($this->getHtmlForPdf($id));

header("Content-Type: application/pdf");
header("Cache-Control: no-cache");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=commercialsale-".$id.".pdf");

echo $pdf;





Here is my Helpler file



<?php

namespace CompanyModuleHelper;

class PdfCrowd
//
// Pdfcrowd constructor.
//
// $username - your username at Pdfcrowd
// $apikey - your API key
// $hostname - API hostname, defaults to pdfcrowd.com
//
function __construct($username, $apikey, $hostname=null)
if ($hostname)
$this->hostname = $hostname;
else
$this->hostname = self::$api_host;
$this->useSSL(false);
$this->fields = array(
'username' => $username,
'key' => $apikey,
'pdf_scaling_factor' => 1,
'html_zoom' => 200);
$this->proxy_name = null;
$this->proxy_port = null;
$this->proxy_username = "";
$this->proxy_password = "";

$this->user_agent = "pdfcrowd_php_client_".self::$client_version."_(http://pdfcrowd.com)";


?>


And here is the error that i am getting...




Fatal error: Uncaught Error: Class 'CompanyModuleHelperPdfCrowd'
not found in
/home/patios/public_html/app/code/Company/Module/Controller/Adminhtml/Quote/QuotePdf.php:49
Stack trace: #0
/home/patios/public_html/vendor/magento/framework/App/Action/Action.php(107):
CompanyModuleControllerAdminhtmlQuoteQuotePdf->execute() #1
/home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(58):
MagentoFrameworkAppActionAction->dispatch(Object(MagentoFrameworkAppRequestHttp))
2 /home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(138):
CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor->___callParent('dispatch',
Array) 3
/home/patios/public_html/vendor/magento/framework/Interception/Interceptor.php(153):
CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor->MagentoFrameworkInterceptionclosure(Object(MagentoFrameworkAppRequestHttp))
4 /home/patios/public_html/generated/code/Company/Module/Controller/Adminhtml
in
/home/patios/public_html/app/code/Company/Module/Controller/Adminhtml/Quote/QuotePdf.php
on line 49




Note:
Same code is working on my local and not on live server.







magento2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 31 '18 at 5:16









Teja Bhagavan Kollepara

2,98141947




2,98141947










asked Jun 8 '18 at 13:09









HardikHardik

12013




12013





bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.









  • 2





    Check exact folder and class name for CompanyModuleHelperPdfCrowd

    – Sohel Rana
    Jun 8 '18 at 13:41











  • Thanks to pointing me. Sorry actually there is capital word issue in my file name. Strange that this is working in my local.

    – Hardik
    Jun 8 '18 at 13:53











  • yes, Linux is naming strict type. But other system like windows, mac not.

    – Sohel Rana
    Jun 8 '18 at 13:55












  • 2





    Check exact folder and class name for CompanyModuleHelperPdfCrowd

    – Sohel Rana
    Jun 8 '18 at 13:41











  • Thanks to pointing me. Sorry actually there is capital word issue in my file name. Strange that this is working in my local.

    – Hardik
    Jun 8 '18 at 13:53











  • yes, Linux is naming strict type. But other system like windows, mac not.

    – Sohel Rana
    Jun 8 '18 at 13:55







2




2





Check exact folder and class name for CompanyModuleHelperPdfCrowd

– Sohel Rana
Jun 8 '18 at 13:41





Check exact folder and class name for CompanyModuleHelperPdfCrowd

– Sohel Rana
Jun 8 '18 at 13:41













Thanks to pointing me. Sorry actually there is capital word issue in my file name. Strange that this is working in my local.

– Hardik
Jun 8 '18 at 13:53





Thanks to pointing me. Sorry actually there is capital word issue in my file name. Strange that this is working in my local.

– Hardik
Jun 8 '18 at 13:53













yes, Linux is naming strict type. But other system like windows, mac not.

– Sohel Rana
Jun 8 '18 at 13:55





yes, Linux is naming strict type. But other system like windows, mac not.

– Sohel Rana
Jun 8 '18 at 13:55










2 Answers
2






active

oldest

votes


















0














Try this:



<?php

namespace CompanyModuleControllerAdminhtmlQuote;

use MagentoFrameworkAppActionAction;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkAppFilesystemDirectoryList as DirectoryList;

use CompanyModuleHelperPdfCrowd;

class QuotePdf extends Action

/**
* @var MagentoFrameworkAppResponseHttpFileFactory
*/
protected $fileFactory;
protected $_mediaDirectory;
protected $directory_list;

protected $dompdfFactory;
protected $layoutFactory;

protected $authSession;
//protected $quote_info;
protected $userFactory;
protected $_pdfCrowd;
public function __construct(
Context $context,
MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
MagentoFrameworkFilesystem $filesystem,
MagentoBackendModelAuthSession $authSession,
PdfCrowd $pdfCrowd,
DirectoryList $directory_list,
MagentoUserModelUserFactory $userFactory
)
parent::__construct($context);
$this->_pdfCrowd = $pdfCrowd;
$this->fileFactory = $fileFactory;
$this->authSession = $authSession;
$this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$this->directory_list = $directory_list;
$this->userFactory = $userFactory;


public function execute()

if($this->authSession->isLoggedIn())

$id = $this->getRequest()->getParam('id');

$client = $this->_pdfCrowd->createPdf("MYUSERNAME", "xxxxxxx-KEY");

// set HTTP response headers
$pdf = $client->convertHtml($this->getHtmlForPdf($id));

header("Content-Type: application/pdf");
header("Cache-Control: no-cache");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=commercialsale-".$id.".pdf");

echo $pdf;





I have replaced method name and called with dependency injection.



<?php

namespace CompanyModuleHelper;

class PdfCrowd
//
// Pdfcrowd constructor.
//
// $username - your username at Pdfcrowd
// $apikey - your API key
// $hostname - API hostname, defaults to pdfcrowd.com
//
function createPdf($username, $apikey, $hostname=null)
if ($hostname)
$this->hostname = $hostname;
else
$this->hostname = self::$api_host;
$this->useSSL(false);
$this->fields = array(
'username' => $username,
'key' => $apikey,
'pdf_scaling_factor' => 1,
'html_zoom' => 200);
$this->proxy_name = null;
$this->proxy_port = null;
$this->proxy_username = "";
$this->proxy_password = "";

$this->user_agent = "pdfcrowd_php_client_".self::$client_version."_(http://pdfcrowd.com)";


?>





share|improve this answer























  • This error. Class CompanyModuleHelperPdfCrowd does not exist in [CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor]

    – Hardik
    Jun 8 '18 at 13:38












  • please run this php bin/magento setup:di:compile then php bin/magento cache:flush

    – kunj
    Jun 8 '18 at 14:22


















0














Use below on your helper file:



class PdfCrowd extends MagentoFrameworkAppHelperAbstractHelper



instead of



class PdfCrowd






share|improve this answer






















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f229214%2fmagento-2-fatal-error-uncaught-error-class-not-found%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Try this:



    <?php

    namespace CompanyModuleControllerAdminhtmlQuote;

    use MagentoFrameworkAppActionAction;
    use MagentoFrameworkAppActionContext;
    use MagentoFrameworkAppFilesystemDirectoryList as DirectoryList;

    use CompanyModuleHelperPdfCrowd;

    class QuotePdf extends Action

    /**
    * @var MagentoFrameworkAppResponseHttpFileFactory
    */
    protected $fileFactory;
    protected $_mediaDirectory;
    protected $directory_list;

    protected $dompdfFactory;
    protected $layoutFactory;

    protected $authSession;
    //protected $quote_info;
    protected $userFactory;
    protected $_pdfCrowd;
    public function __construct(
    Context $context,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkFilesystem $filesystem,
    MagentoBackendModelAuthSession $authSession,
    PdfCrowd $pdfCrowd,
    DirectoryList $directory_list,
    MagentoUserModelUserFactory $userFactory
    )
    parent::__construct($context);
    $this->_pdfCrowd = $pdfCrowd;
    $this->fileFactory = $fileFactory;
    $this->authSession = $authSession;
    $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
    $this->directory_list = $directory_list;
    $this->userFactory = $userFactory;


    public function execute()

    if($this->authSession->isLoggedIn())

    $id = $this->getRequest()->getParam('id');

    $client = $this->_pdfCrowd->createPdf("MYUSERNAME", "xxxxxxx-KEY");

    // set HTTP response headers
    $pdf = $client->convertHtml($this->getHtmlForPdf($id));

    header("Content-Type: application/pdf");
    header("Cache-Control: no-cache");
    header("Accept-Ranges: none");
    header("Content-Disposition: attachment; filename=commercialsale-".$id.".pdf");

    echo $pdf;





    I have replaced method name and called with dependency injection.



    <?php

    namespace CompanyModuleHelper;

    class PdfCrowd
    //
    // Pdfcrowd constructor.
    //
    // $username - your username at Pdfcrowd
    // $apikey - your API key
    // $hostname - API hostname, defaults to pdfcrowd.com
    //
    function createPdf($username, $apikey, $hostname=null)
    if ($hostname)
    $this->hostname = $hostname;
    else
    $this->hostname = self::$api_host;
    $this->useSSL(false);
    $this->fields = array(
    'username' => $username,
    'key' => $apikey,
    'pdf_scaling_factor' => 1,
    'html_zoom' => 200);
    $this->proxy_name = null;
    $this->proxy_port = null;
    $this->proxy_username = "";
    $this->proxy_password = "";

    $this->user_agent = "pdfcrowd_php_client_".self::$client_version."_(http://pdfcrowd.com)";


    ?>





    share|improve this answer























    • This error. Class CompanyModuleHelperPdfCrowd does not exist in [CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor]

      – Hardik
      Jun 8 '18 at 13:38












    • please run this php bin/magento setup:di:compile then php bin/magento cache:flush

      – kunj
      Jun 8 '18 at 14:22















    0














    Try this:



    <?php

    namespace CompanyModuleControllerAdminhtmlQuote;

    use MagentoFrameworkAppActionAction;
    use MagentoFrameworkAppActionContext;
    use MagentoFrameworkAppFilesystemDirectoryList as DirectoryList;

    use CompanyModuleHelperPdfCrowd;

    class QuotePdf extends Action

    /**
    * @var MagentoFrameworkAppResponseHttpFileFactory
    */
    protected $fileFactory;
    protected $_mediaDirectory;
    protected $directory_list;

    protected $dompdfFactory;
    protected $layoutFactory;

    protected $authSession;
    //protected $quote_info;
    protected $userFactory;
    protected $_pdfCrowd;
    public function __construct(
    Context $context,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkFilesystem $filesystem,
    MagentoBackendModelAuthSession $authSession,
    PdfCrowd $pdfCrowd,
    DirectoryList $directory_list,
    MagentoUserModelUserFactory $userFactory
    )
    parent::__construct($context);
    $this->_pdfCrowd = $pdfCrowd;
    $this->fileFactory = $fileFactory;
    $this->authSession = $authSession;
    $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
    $this->directory_list = $directory_list;
    $this->userFactory = $userFactory;


    public function execute()

    if($this->authSession->isLoggedIn())

    $id = $this->getRequest()->getParam('id');

    $client = $this->_pdfCrowd->createPdf("MYUSERNAME", "xxxxxxx-KEY");

    // set HTTP response headers
    $pdf = $client->convertHtml($this->getHtmlForPdf($id));

    header("Content-Type: application/pdf");
    header("Cache-Control: no-cache");
    header("Accept-Ranges: none");
    header("Content-Disposition: attachment; filename=commercialsale-".$id.".pdf");

    echo $pdf;





    I have replaced method name and called with dependency injection.



    <?php

    namespace CompanyModuleHelper;

    class PdfCrowd
    //
    // Pdfcrowd constructor.
    //
    // $username - your username at Pdfcrowd
    // $apikey - your API key
    // $hostname - API hostname, defaults to pdfcrowd.com
    //
    function createPdf($username, $apikey, $hostname=null)
    if ($hostname)
    $this->hostname = $hostname;
    else
    $this->hostname = self::$api_host;
    $this->useSSL(false);
    $this->fields = array(
    'username' => $username,
    'key' => $apikey,
    'pdf_scaling_factor' => 1,
    'html_zoom' => 200);
    $this->proxy_name = null;
    $this->proxy_port = null;
    $this->proxy_username = "";
    $this->proxy_password = "";

    $this->user_agent = "pdfcrowd_php_client_".self::$client_version."_(http://pdfcrowd.com)";


    ?>





    share|improve this answer























    • This error. Class CompanyModuleHelperPdfCrowd does not exist in [CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor]

      – Hardik
      Jun 8 '18 at 13:38












    • please run this php bin/magento setup:di:compile then php bin/magento cache:flush

      – kunj
      Jun 8 '18 at 14:22













    0












    0








    0







    Try this:



    <?php

    namespace CompanyModuleControllerAdminhtmlQuote;

    use MagentoFrameworkAppActionAction;
    use MagentoFrameworkAppActionContext;
    use MagentoFrameworkAppFilesystemDirectoryList as DirectoryList;

    use CompanyModuleHelperPdfCrowd;

    class QuotePdf extends Action

    /**
    * @var MagentoFrameworkAppResponseHttpFileFactory
    */
    protected $fileFactory;
    protected $_mediaDirectory;
    protected $directory_list;

    protected $dompdfFactory;
    protected $layoutFactory;

    protected $authSession;
    //protected $quote_info;
    protected $userFactory;
    protected $_pdfCrowd;
    public function __construct(
    Context $context,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkFilesystem $filesystem,
    MagentoBackendModelAuthSession $authSession,
    PdfCrowd $pdfCrowd,
    DirectoryList $directory_list,
    MagentoUserModelUserFactory $userFactory
    )
    parent::__construct($context);
    $this->_pdfCrowd = $pdfCrowd;
    $this->fileFactory = $fileFactory;
    $this->authSession = $authSession;
    $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
    $this->directory_list = $directory_list;
    $this->userFactory = $userFactory;


    public function execute()

    if($this->authSession->isLoggedIn())

    $id = $this->getRequest()->getParam('id');

    $client = $this->_pdfCrowd->createPdf("MYUSERNAME", "xxxxxxx-KEY");

    // set HTTP response headers
    $pdf = $client->convertHtml($this->getHtmlForPdf($id));

    header("Content-Type: application/pdf");
    header("Cache-Control: no-cache");
    header("Accept-Ranges: none");
    header("Content-Disposition: attachment; filename=commercialsale-".$id.".pdf");

    echo $pdf;





    I have replaced method name and called with dependency injection.



    <?php

    namespace CompanyModuleHelper;

    class PdfCrowd
    //
    // Pdfcrowd constructor.
    //
    // $username - your username at Pdfcrowd
    // $apikey - your API key
    // $hostname - API hostname, defaults to pdfcrowd.com
    //
    function createPdf($username, $apikey, $hostname=null)
    if ($hostname)
    $this->hostname = $hostname;
    else
    $this->hostname = self::$api_host;
    $this->useSSL(false);
    $this->fields = array(
    'username' => $username,
    'key' => $apikey,
    'pdf_scaling_factor' => 1,
    'html_zoom' => 200);
    $this->proxy_name = null;
    $this->proxy_port = null;
    $this->proxy_username = "";
    $this->proxy_password = "";

    $this->user_agent = "pdfcrowd_php_client_".self::$client_version."_(http://pdfcrowd.com)";


    ?>





    share|improve this answer













    Try this:



    <?php

    namespace CompanyModuleControllerAdminhtmlQuote;

    use MagentoFrameworkAppActionAction;
    use MagentoFrameworkAppActionContext;
    use MagentoFrameworkAppFilesystemDirectoryList as DirectoryList;

    use CompanyModuleHelperPdfCrowd;

    class QuotePdf extends Action

    /**
    * @var MagentoFrameworkAppResponseHttpFileFactory
    */
    protected $fileFactory;
    protected $_mediaDirectory;
    protected $directory_list;

    protected $dompdfFactory;
    protected $layoutFactory;

    protected $authSession;
    //protected $quote_info;
    protected $userFactory;
    protected $_pdfCrowd;
    public function __construct(
    Context $context,
    MagentoFrameworkAppResponseHttpFileFactory $fileFactory,
    MagentoFrameworkFilesystem $filesystem,
    MagentoBackendModelAuthSession $authSession,
    PdfCrowd $pdfCrowd,
    DirectoryList $directory_list,
    MagentoUserModelUserFactory $userFactory
    )
    parent::__construct($context);
    $this->_pdfCrowd = $pdfCrowd;
    $this->fileFactory = $fileFactory;
    $this->authSession = $authSession;
    $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
    $this->directory_list = $directory_list;
    $this->userFactory = $userFactory;


    public function execute()

    if($this->authSession->isLoggedIn())

    $id = $this->getRequest()->getParam('id');

    $client = $this->_pdfCrowd->createPdf("MYUSERNAME", "xxxxxxx-KEY");

    // set HTTP response headers
    $pdf = $client->convertHtml($this->getHtmlForPdf($id));

    header("Content-Type: application/pdf");
    header("Cache-Control: no-cache");
    header("Accept-Ranges: none");
    header("Content-Disposition: attachment; filename=commercialsale-".$id.".pdf");

    echo $pdf;





    I have replaced method name and called with dependency injection.



    <?php

    namespace CompanyModuleHelper;

    class PdfCrowd
    //
    // Pdfcrowd constructor.
    //
    // $username - your username at Pdfcrowd
    // $apikey - your API key
    // $hostname - API hostname, defaults to pdfcrowd.com
    //
    function createPdf($username, $apikey, $hostname=null)
    if ($hostname)
    $this->hostname = $hostname;
    else
    $this->hostname = self::$api_host;
    $this->useSSL(false);
    $this->fields = array(
    'username' => $username,
    'key' => $apikey,
    'pdf_scaling_factor' => 1,
    'html_zoom' => 200);
    $this->proxy_name = null;
    $this->proxy_port = null;
    $this->proxy_username = "";
    $this->proxy_password = "";

    $this->user_agent = "pdfcrowd_php_client_".self::$client_version."_(http://pdfcrowd.com)";


    ?>






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jun 8 '18 at 13:18









    kunjkunj

    2,6502423




    2,6502423












    • This error. Class CompanyModuleHelperPdfCrowd does not exist in [CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor]

      – Hardik
      Jun 8 '18 at 13:38












    • please run this php bin/magento setup:di:compile then php bin/magento cache:flush

      – kunj
      Jun 8 '18 at 14:22

















    • This error. Class CompanyModuleHelperPdfCrowd does not exist in [CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor]

      – Hardik
      Jun 8 '18 at 13:38












    • please run this php bin/magento setup:di:compile then php bin/magento cache:flush

      – kunj
      Jun 8 '18 at 14:22
















    This error. Class CompanyModuleHelperPdfCrowd does not exist in [CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor]

    – Hardik
    Jun 8 '18 at 13:38






    This error. Class CompanyModuleHelperPdfCrowd does not exist in [CompanyModuleControllerAdminhtmlQuoteQuotePdfInterceptor]

    – Hardik
    Jun 8 '18 at 13:38














    please run this php bin/magento setup:di:compile then php bin/magento cache:flush

    – kunj
    Jun 8 '18 at 14:22





    please run this php bin/magento setup:di:compile then php bin/magento cache:flush

    – kunj
    Jun 8 '18 at 14:22













    0














    Use below on your helper file:



    class PdfCrowd extends MagentoFrameworkAppHelperAbstractHelper



    instead of



    class PdfCrowd






    share|improve this answer



























      0














      Use below on your helper file:



      class PdfCrowd extends MagentoFrameworkAppHelperAbstractHelper



      instead of



      class PdfCrowd






      share|improve this answer

























        0












        0








        0







        Use below on your helper file:



        class PdfCrowd extends MagentoFrameworkAppHelperAbstractHelper



        instead of



        class PdfCrowd






        share|improve this answer













        Use below on your helper file:



        class PdfCrowd extends MagentoFrameworkAppHelperAbstractHelper



        instead of



        class PdfCrowd







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 8 '18 at 14:24









        Sukumar GoraiSukumar Gorai

        6,8753729




        6,8753729



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f229214%2fmagento-2-fatal-error-uncaught-error-class-not-found%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Identifying “long and narrow” polygons in with PostGISlength and width of polygonWhy postgis st_overlaps reports Qgis' “avoid intersections” generated polygon as overlapping with others?Adjusting polygons to boundary and filling holesDrawing polygons with fixed area?How to remove spikes in Polygons with PostGISDeleting sliver polygons after difference operation in QGIS?Snapping boundaries in PostGISSplit polygon into parts adding attributes based on underlying polygon in QGISSplitting overlap between polygons and assign to nearest polygon using PostGIS?Expanding polygons and clipping at midpoint?Removing Intersection of Buffers in Same Layers

            Masuk log Menu navigasi

            อาณาจักร (ชีววิทยา) ดูเพิ่ม อ้างอิง รายการเลือกการนำทาง10.1086/39456810.5962/bhl.title.447410.1126/science.163.3863.150576276010.1007/BF01796092408502"Phylogenetic structure of the prokaryotic domain: the primary kingdoms"10.1073/pnas.74.11.5088432104270744"Towards a natural system of organisms: proposal for the domains Archaea, Bacteria, and Eucarya"1990PNAS...87.4576W10.1073/pnas.87.12.4576541592112744PubMedJump the queueexpand by handPubMedJump the queueexpand by handPubMedJump the queueexpand by hand"A revised six-kingdom system of life"10.1111/j.1469-185X.1998.tb00030.x9809012"Only six kingdoms of life"10.1098/rspb.2004.2705169172415306349"Kingdoms Protozoa and Chromista and the eozoan root of the eukaryotic tree"10.1098/rsbl.2009.0948288006020031978เพิ่มข้อมูล