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

            Masuk log Menu navigasi

            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

            Старые Смолеговицы Содержание История | География | Демография | Достопримечательности | Примечания | НавигацияHGЯOLHGЯOL41 206 832 01641 606 406 141Административно-территориальное деление Ленинградской области«Переписная оброчная книга Водской пятины 1500 года», С. 793«Карта Ингерманландии: Ивангорода, Яма, Копорья, Нотеборга», по материалам 1676 г.«Генеральная карта провинции Ингерманландии» Э. Белинга и А. Андерсина, 1704 г., составлена по материалам 1678 г.«Географический чертёж над Ижорскою землей со своими городами» Адриана Шонбека 1705 г.Новая и достоверная всей Ингерманландии ланткарта. Грав. А. Ростовцев. СПб., 1727 г.Топографическая карта Санкт-Петербургской губернии. 5-и верстка. Шуберт. 1834 г.Описание Санкт-Петербургской губернии по уездам и станамСпецкарта западной части России Ф. Ф. Шуберта. 1844 г.Алфавитный список селений по уездам и станам С.-Петербургской губернииСписки населённых мест Российской Империи, составленные и издаваемые центральным статистическим комитетом министерства внутренних дел. XXXVII. Санкт-Петербургская губерния. По состоянию на 1862 год. СПб. 1864. С. 203Материалы по статистике народного хозяйства в С.-Петербургской губернии. Вып. IX. Частновладельческое хозяйство в Ямбургском уезде. СПб, 1888, С. 146, С. 2, 7, 54Положение о гербе муниципального образования Курское сельское поселениеСправочник истории административно-территориального деления Ленинградской области.Топографическая карта Ленинградской области, квадрат О-35-23-В (Хотыницы), 1930 г.АрхивированоАдминистративно-территориальное деление Ленинградской области. — Л., 1933, С. 27, 198АрхивированоАдминистративно-экономический справочник по Ленинградской области. — Л., 1936, с. 219АрхивированоАдминистративно-территориальное деление Ленинградской области. — Л., 1966, с. 175АрхивированоАдминистративно-территориальное деление Ленинградской области. — Лениздат, 1973, С. 180АрхивированоАдминистративно-территориальное деление Ленинградской области. — Лениздат, 1990, ISBN 5-289-00612-5, С. 38АрхивированоАдминистративно-территориальное деление Ленинградской области. — СПб., 2007, с. 60АрхивированоКоряков Юрий База данных «Этно-языковой состав населённых пунктов России». Ленинградская область.Административно-территориальное деление Ленинградской области. — СПб, 1997, ISBN 5-86153-055-6, С. 41АрхивированоКультовый комплекс Старые Смолеговицы // Электронная энциклопедия ЭрмитажаПроблемы выявления, изучения и сохранения культовых комплексов с каменными крестами: по материалам работ 2016-2017 гг. в Ленинградской области