Using TCPDF as an engine through CakePDF - cakephp

I'm using Ceeram's CakePDF plugin on CakePHP 2.2. It makes generating PDFs using Cake's layouts and views very easy and for the most part I have not had any problems with it.
However, I want to be able to access some of the more advanced features of TCPDF, specifically the barcode features.
If I was using TCPDF directly, I could just do $pdf->writeBarcode(); but as I'm using TCPDF as an engine in the CakePDF Plugin, I'm not sure how to go about accessing it, or if it's even possible.
$CakePdf->writeBarcode(); doesn't work, but then I wouldn't really have expected it to. There is nothing in Ceeram's docs that mentions it, though.

It does not support that by default, it just converts your view into a rendered PDF, but it won't let you access the "advanced" functionalities of your PDF Engine. Of course you are always free to extend the plugin to do allow this feature. I reckon you'd have to add it in the Pdf/CakePdf.php class file to get it to work.

Related

How can I migrate the existing MVC+AngularJS application to Mvc+Angular4 application

I have an existing application written in mvc5 and Angular1.I want to convert all Angular1 code to Angular4 code. Is there any tool available for migration/I have to do manually.
No, There is no such tool available yet.
You have to create it manually. You need to convert all your pages in components as per documentation
These are few document links you can follow though.
https://www.joshmorony.com/how-to-convert-an-ionic-1-application-to-ionic-2/
https://angular.io/docs/ts/latest/guide/upgrade.html
https://www.codementor.io/angularjs/tutorial/migrating-from-angular-1-to-angular-2
https://vsavkin.com/migrating-angular-1-applications-to-angular-2-in-5-simple-steps-40621800a25b

Creating Custom data type in umbraco 7.3 without using AngularJS

I want to create a custom data type in Umbraco 7.3 without using AngularJS but I cannot do it because I don't have any knowledge about AngularJs.
I googled and saw that all of examples wrote by using AngularJs.
Is there any way to create a custom data type in Umbraco 7.3 without using Angular?
If not, please introduce some good sources to learning Angular that should be simple and practical.
No I don't believe it is possible since the interface is all in Angular but I could be wrong. Certainly the method that the team would prefer us to use is the Angular method. I have to be honest it was a little bit of a leap for me too creating my first editor but it's really not that difficult, trust me.
There is a good thread in the Umbraco form here: https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/46925-Custom-datatype-in-umbraco-701
And I would advise downloading the Umbraco source as the best examples are in the source itself.
If I remember correctly, you can generate custom property editors using just C# classes and class attributes. Or you can extend existing data types and tweak them. The only problem is you're limited to lists and displaying existing JSON feeds - most of which is best done using extensions like uComponents and NuPickers.
Have you viewed Nibble's blog? He's the primary source for most things data type related.
For your situation, the nuPickers dot net extensions sounds best. There's examples on this link.

JSPs for a simple Project Reporting Web App?

I'm about to start developing a simple reporting tool for tasks in international projects. In a nutshell: using the tool, a project is created, defining team members, tasks, and work packages. Team members will be asked to periodically submit reports on the work they've done (related to tasks and/or work packages). These reports will be stored and accessed trough the tool.
I'll use Google App Engine (client requirement) and its datastore (using JDO). But I want to ask you for advice on the frontend part: JSP looks pretty messy for non Java developers... any other idea???
Thanks!!!
Seems like at the moment it's either java or python. However, you may want to look at Grails. GSPs might looks a little less 'messy'. I'm suggesting Grails based on your description of the project, that I suspect will turn out anything but simple later on. You might end up being glad for the mix of constraints and flexibility that Grails will afford.
JSP doesn't need to be any messier than other similar HTML presentation frameworks, it really comes down to implementation. That being said, it is old Java technology which means it's not being kept up to date, and finding a good single source of documentation is difficult.
If you don't want to use JSP, there are other frameworks you can use, you just need to make sure they're compatible with Google App Engine.
The new kid on the block is the Play framework, and that's a Java MVC framework similar to Ruby on Rails. You can find a tutorial here: http://viralpatel.net/blogs/first-play-framework-gae-siena-application-tutorial-example/
If you're going to use Spring, check out this question: Alternatives to JSP for Spring MVC view layer
For a front end developer, if the code is separated correctly, you won't have to know anything about Java since there shouldn't be any Java mixed in with the HTML. If that's your only worry, then I would just go with JSP to keep things simple unless the team has experience with another technology.

Internationalization and Localization in CakePHP 2.1

I am building a dual language app in CakePHP 2.1.x because of the great reviews of Cake's "built-in" localization features. However, I am wrestling with getting this powerful feature to work.
I know that this topic has been tackled for previous versions of Cake (here, here, here, and here), but it hasn't been solved for Cake 2.x. I am also referencing these articles in the cookbook (yes, I've read the manual):
http://book.cakephp.org/2.0/en/core-libraries/internationalization-and-localization.html
http://book.cakephp.org/2.0/en/core-libraries/behaviors/translate.html
Couple of things -- I do not want to do separate subdomains for each language. Instead, I prefer URL based language switching with the click of a button (in this case, a flag icon). The site will be actively maintained, so the content needs to update dynamically. Asking the client to maintain two separate sites/databases is out of the question.
I have Translate behavior set up for my PostModel, but I can't tell if it's working. I also initialized I18n by running I18n in the console, have confirmed the database tables exist, have set up my .po files, and have wrapped all my content in __(). However, when I change the default language in my browser to French, the site remains in English.
I've tried the P28n Component, but I think it's outdated for Cake 2.x. I also tried URL-based language switching based on this nuts-and-bolts-of-cakephp article, but apparently it's incompatible with the new CakePHP API.
Can anyone point me in the direction of a tutorial or instructions that work with CakePHP 2.x? One not already referenced here?
Update: I found this article: http://www.localizingjapan.com/blog/2011/11/10/localizing-a-cakephp-application/comment-page-1/#comment-7467. Does anyone know where you place the code for CakeSession::write('Config.language', 'fre'); and setlocale("LC_ALL", "fr_FR.utf8");?
Simply put the code in AppController::beforeFilter() and set the values based on however you retrieve the language, from a post request or a part of the URL.

Using Zend Lucene in Cakephp

I am creating a webapp in Cakephp, and am thinking of implementing a search function in it. I read about Zend Lucene providing the search capabilities for native PHP webapps.
I have my web pages all created without using any kind of database functionality. How will I able to add webpages to the indexes? I don't mean the code, just an idea would help.
Regards
I don't know anything about Lucene, but a start, if you're using cake, would be to put the existing pages under the control of the Cake pages controller - read about it in the book http://book.cakephp.org or google more information.
After that, I would probably start thinking about using fgetss() or something like that to scrape the pages.
Me? I'd get the existing pages into the database and set up a Article[n]-[m]Word datamodel. Much easier to deal with them then.

Resources