Error while generating pdf in Joomla 3.0 - pdf

I have created my custom component.
Every thing is working fine.
but when I am appending format=pdf in URL Joomla shows error
"0 - Invalid controller: name='xxxxxxxx', format='pdf'"
If I am adding format=html then its working fine.
I have followed this article for pdf generating.
joomla pdf
Thanks

Have you included your controller.php file in your custom component's XML manifest file? If you don't have it there, then this is most likely the cause of your problem.

Related

Can't import PDF with mpdf

everyone.
I started using mpdf on my website recently. Creating new pdfs is working fine, but i can't import existing ones. I get this error whenever i try to execute the import:
mPDF error: Cannot open ../folder1/folder2/folder3/folder4/folder5/thisisthepdf.pdf !
(that is not the real path)
I included the mpdf in the php. The folder and the files are on chmod 777 and the pdfs are all version 1.4
This is the way i am trying to import.
$mpdf=new mPDF();
$mpdf->SetImportUse();
$pagecount = $mpdf->SetSourceFile('../folder1/folder2/folder3/folder4/folder5/thisisthepdf.pdf');
$tplId = $mpdf->ImportPage($pagecount);
$mpdf->UseTemplate($tplId);
$mpdf->WriteHTML('Hallo World');
$mpdf->Output();
I tried various ways to import i found on stackoverflow and other sites, but nothing worked. Not even the code from the official mpdf manual i am using (the one above) is working.
Trying to solve this issue for quite a while now, but i am out of ideas. I Hope someone can help me. Thanks in advance!
This error message is raised because of a failing call of a simple fopen(). Which means that the PHP script simply cannot access the file.
So ensure that the path is valid by e.g. passing it to realpath(), as it seems to be a relative path. If this evaluates to false the path is simply wrong. Otherwise it is a permission issue.

Bundle Config relative path added controller name

Sorry for my English...
I have a problem with BundleCOnfig...
I added new script bundle:
bundles.Add(new ScriptBundle("~/bundles/js").Include(
"~/assets/js/progress-bar/src/jquery.velocity.min.js",
"~/assets/js/progress-bar/number-pb.js",
"~/assets/js/progress-bar/progress-app.js",
"~/assets/js/preloader.js",
"~/assets/js/bootstrap.js",
"~/assets/js/app.js",
"~/assets/js/load.js",
"~/assets/js/main.js"));
And add this code to _Layout.cshtml:
#Scripts.Render("~/bundles/js")
When I load page at localhost:21612/ no errors occur. Page displayed correctly:
Normal load
But if I load page at localhost:21612/Home/Index I get errors. And in path is added controller names:
Errors
I do not understand what the problem is, because the relative path to the script, why is inserted controller name?
UPDATE: Problem solved. The fact is that in the file main.js, all the way to the other scripts were installed as src="assets/, and should be src="/assets/
The tilde has changed in MVC5 to do clever things with URL rewriting. I don't understand why it's doing this to you but if you're doing any URL rewriting, you can turn off overly clever fixing of on-page URLS, see this answer:
https://stackoverflow.com/a/12105210/7353829

How to get html content remotely and open locally

I want to get the content remotely for a html page and open locally in the webview. But I want this html to have access to the Ti namespace, so it implies that the html must be running locally.
Have tried to create the webview passing the content as the "html" parameter, but Ti namespace doesnt work that way.
Then, I tried to write the content to a html file on Ti.Filesystem.applicationDataDirectory. The page opens OK, but the Ti namespace doesnt work on the html either.
Finaly, I created a html file in assets folder on the project and when I get the html code I try to write on it so I could open using 'url' : '/myfile.html'. But when I try to write it gives java.io.IOException: read only
How can I achieve this? Again: I'm trying to get a html content remotely and run locally so I can have access to Ti namespace.
Thanks
I messed up during my testings. Downloading the html and then opening the webview passing the html code to "html" parameter on the webview works just fine. The fireEvent works that way inside the html.
It was not working because it was other problem not related that I fixed.

Have error for converting to website from web app

Hi I convert the web app to web site. I follow this link to do it. However I have an error for a few pages which are .ascx and the Global.asax. The error is “Context is not a member of …”. I also exclude the .vbroj file.
I searched the web for fixing the above error and found that link http://forums.asp.net/t/1148374.aspx?Context+is+not+a+member+of+Page+name+
. Although I did what it said, but the error didn’t go away. Would someone tell me what I can solve the issue.
Summary what I did:
1. Delete the .desginer file
2. Changed Codebehind to CodeFile
3. Change the path of the code file with full path within the root directory.
For example:
Form CodeFile=" Footer.ascx.vb" Inherits="Testing.Footer"
To CodeFile="~/Templates/Footer.ascx.vb" Inherits="Testing.Footer"
I solved the problem by deleted the namespace of inherits and change the full path of CodeFile. Also change the full path of #Reference

Orchard CMS Extension Manifest could not loaded

I'm trying to make my own calendar widget and module by following a tutorial on youtube and everything works fine until now. I got this kind of error in the Orchard Dashboard
"The extension 'BYUtv.CalendarWidget' manifest could not be loaded. It was ignored."
I'm using visual studio 2012 in the development and oddly the VS 2012 doesn't show me any error message at all. I'm using Orchard version 1.6.1.0. Can anyone tell me what seems to be the problem? Thanks
It sounds like there is something wrong with your Module.txt. Check that the file is valid, and check your file system permissions for that module.
If that fails, then from searching Orchard's code you should in that the error message is emitted from Orchard.Environment.Extensions.Folders.ExtensionHarvester. Put a breakpoint in the AvailableExtensionsInFolder method in that class and step through until you get an exception message.