cakephp certificate printing Image to PDF writer and replace contents - cakephp

My client have pre-printed certificates. Now, we want a dynamic run time certificate printing options as per matches schedules into the Match arranged.
One option I have seen at .Net guys help, they have generated PDF of scanned Certificate Image with PDF Writer and created textbox like to replace Name, txtName, then Date as txtDate etc for replacing dynamic values run time.
However with PHP/CakePHP, Any idea, how can we achieve the same logic with our requirement.

You should install tcpdf, and explore more.
Create a template of pdf and all dynamic values replace with your cake values.
See image as background on tcpdf example. http://www.tcpdf.org/examples.php [51]

Related

Multiple Similar (Duplicate) Reports

I currently created a report that I would like to duplicate 40 times but with a different filter each time. So far I'm afraid this is only possible with a very manual process but I was hoping if someone has a faster solution?
Would it be possible to connect to the DataStudio API (if there is one) and run a script for this?
Also, making a design change can be problematic as it needs to be copied to 40 reports. Does anyone have a suggestion for this?
A report is stored as an RDL file in the file system. Its of XML format. Make a copy of the file in the file system and open the copy using a text editor (I prefer notepad++) and find the parameter. Change the paramater to whatever value you want it to be and save the file under a different name. I would include the parameter name in the report name. If the report as using 'Memphis' I would name the report Sales_Memphis.RDL.
Do this 40 times. Be very careful about not changing the structure of the XML file (Don't change any of the element names or opening and closing symbols(<>). Re-import the file into SSDT report project to verify it is using the correct value.
To import a file into an existing project:
Right click on “Reports” folder and select “Add” then “Existing Item”
Now file browser window will open.
Find the file and double click on it.
Ideally you can have a dropdown with all the possible values for users to choose from but I guess that is not appropriate for your needs.
If this is a good solution please check it off as valid solution.
I checked this with google support and apparently there is no way yet to do this.
There are currently no API's available to do this nor can you download something similar to an RDL file. Right now the only way is manual duplication and to make adjustments for each report separately.
Have you looked into custom bookmarking. It sounds like it might be able to address the problem you're expressing. This way you would only have one report, but the links you would share would automatically apply the correct filter value.

Data Extraction from PDF

I get 15+ PDF's a day that I have to enter into a database. They are generated from a table where the "Blanks" are filled in from specific table fields. Any tools or python code examples I could use to try and develop a means of extracting the data from the PDF to either write to or create a table to import to the database table? The Database is currently Access mdb.
Thanks
There are a number of approaches that will work.
One simple approach is to simply print the PDF file out to a text file and then have Access import that text. All recent versions of windows allow you to install a “text” printer that outputs the printing of a document to a text file. You can have access “process” a folder of pdfs, print them to text and then import those text files. You might need some VBA to remove “pages” and some extra lines before you import the data into Access.
Another approach is to use Word (Automate from Access) to open a PDF. When word opens a pdf, it converts it to a word document. This approach will even format rows as a word table. You can then pluck out that table data and send that data to word. You can likely pull that text out without writing the data out to a text file – or just use Words “save-as” to a text file (you can automate this process from Access).
Another approach is to use the free Ghost Script library that can extract text from a PDF (this I would consider if did not have word at your disposal).
So which solution is best will much depend on the current software you going to have installed on the computer running Access. Opening the pdf files with word would be my first choice and test.
At my old job we used Cogniview which converted PDF to Excel spreadsheets quite quickly. If you want to use Python, a quick search yielded me this which seems straight forward enough, PDF to XLS with Python

File Maker Scripting - Sending Different Attachment

Is there a way to send a mail with different PDF file to different contacts using file maker?
I am aware of sending batch emails with one attachment but I would like to send a personalize PDF for each contact which seems not so simple.
Also
Can I add PDF files to the table itself or would I have to use the path to the file?
Example:
Table 1
**Name** [James Brown] [James Blue]
**Email** [brown.j#gmail.com] [blue.j#gmail.com]
**PDFfileAttchamnet** [folder/PDF/JamesBrown.pdf] [folder/PDF/JamesBlue.pdf]
So an Email for James Brown would look like:
Dear James Brown, please see the attached file.
Attachment [JamesBrown.pdf] {actual file}
and
Dear James Blue, please see the attached file.
Attachment [JamesBlue.pdf] {actual file}
I think you can solve it by creating container field in you database and import the pdfs in it.
then you can use export Field Contents[] to export it and send it by email
Hope it useful
I would like to send a personalize PDF for each contact which seems
not so simple.
Find the records of contacts you want to include and loop among them, sending mail to each one individually (i.e. without selecting the 'Collect addresses across found set' option).
Can I add PDF files to the table itself or would I have to use the
path to the file?
You can do either, it's up to you. If the path to the file can be calculated (as in your example), you can calculate it right there in the Send Mail script step.
Note that you can also generate the PDF files during the process itself.
Do I understand correctly that you would actually like to personalize the PDF document(s)?
This is possible, maybe not very simple, but quite simple. The trick is to prepare the PDF as a form, and then fill the form fields to personalize.
PDF has a native forms data format (called FDF), which is described in ISO 32000 (as well as the older PDF specification documents provided by Adobe, as you can find in the Acrobat SDK, downloadable from the Adobe website).
FDF is a simple structured text file, which can easily be assembled using FileMaker (I have done that routinely for several catalog projects). The easiest way to get going is to open the form in Acrobat, fill in the fields, and then export the data as FDF. This gives you the pattern to "fill in the blanks".
So, you create the FDF files using Filemaker. With them you can fill the blank form and feed the saved document to the eMail system.
Which tool to use to fill the blank form depends on the volume you have to process. Acrobat is not very powerful (and you may end up in a bit of a legal gray zone, because Acrobat is not set up for being used as a service). There are applications which are made specifically for filling out forms on a server (such as FDFMerge by Appligent), or there are also several libraries which have the tools to fill out forms (iText or pdflib come to my mind). These applications also allow you to flatten the PDF, which means that there are no longer form fields, but their contents becomes part of the base.
The resulting file can now be either made to an eMail attachment, or you make it available on a server and send an eMail with the link to the file (which method you will use may depend on security and privacy regulations).

How to create a api in HTML 5 that is cut/copy/paste

I was planning to create a new web app based on extjs, but i need to create a file upload area where i can work on file uploading , i have tried drag and drop method in html 5 but we don't need that, we need a method where a user can copy a file whatever it is(not big than 20 mb)and that file location got copied on the clipboard and when we paste the file in the selected area of the uploader and the file gets uploaded, what is the best way to go about this?
There is no general access to the clipboard from browsers these days. There is a flash object called zeroclipboard that can be used for some clipboard access.
For your particular need (if all the data is exchanged within your page), you may not need to use the actual clipboard and perhaps you can just use some global storage to store things that are copied for later paste (using your own copy/paste instead of clipboard operations).
This Specification to achieve this is: http://dev.w3.org/2006/webapi/clipops/
But seens that it isn't implemented in any browser yet (perhaps IE9)
This could help you : https://stackoverflow.com/a/6338207/230526
If not interested in standard based solution, firefox, because of the plugins API, have a workaround for this, that you can see here: https://developer.mozilla.org/en/Using_the_Clipboard
I also found this piece of code that promises to work on Webkit based browsers: http://forum.maxthon.com/viewthread.php?tid=79469&page=1#pid493997
If you need to have all browsers support, then Zero Clipboard as stated here, is the way to go.
UPDATE: Found this Jquery based script ( http://archive.plugins.jquery.com/project/clipboard ), that uses IE native API to access clipboard and Flash to all others. This could be a start point to merge all the others solutions and fallback to flash whether not available.
For Zero Clipboard, there is this one: http://www.steamdev.com/zclip/

how to add content of word doc file in jsp file using include action?

I am trying to include the text content of microsoft word file in my jsp file.... I am not able to figure out the solution.
You'll need to use Apache POI to parse the text out of the MS Word Document.
It is not possible to include proprietary/platform-specific formats in a HTML page without a good plugin in the webbrowser. Besides, in case of MS Office documents you're heavily dependent on the client machine whether it would work or not. Not every Windows machine has MS Office installed and even then not every of them has a browser plugin for that. This ain't going to work in non-Windows machines.
So you have basically two options:
Programmatically extract the Word document yourself and display contents as HTML.
Convert the Word document to a more standard format supported by a majority, like PDF.
If you prefer 1, you could use the aforementioned (and memory hogging) Apache POI for that. Or you could use the more memory efficient (and OOo based) JODConverter for that. It can even convert Word documents to HTML or even to PDF so that you've a solution for option 2 as well. In this case you can just use <iframe> or <object> tags to display the PDF embedded in HTML.

Resources