I am trying to implement QR code. i've successfully implement it using phpqrcode. However I don't know about how to decode the QR code using webcam and php or javascript. I've tried to search it on google, but can't find any solution for this. Anyone could help me? Thank you so much
you could use this jquery webcam plugin and then send the image to php-zbarcode. It uses zbar which can read qrcodes. Note that the plugin requires flash.
There is also jsqrcode which you could use to scan and interpret the QR Code, however this requires HTML5 for displaying the webcam output, and flash for capturing.
Here is a previous question pertaining to javascript-only solutions
Related
i need to display a pdf on the website. i've tried many ways but none of it worked for me.
let me explain what i've tried and why this is not ok for me.
i tried to insert pdf into html with <object> and <embed> tags. its ok if client browser has flash. but android phones don't have it so this is not a solution. plus iphone streching pdf so it is not readable.
then i tried to use just an <iframe> element. works fine only if browser has pdf plugin. in other cases browser starts file downloading. so this is not a solution too.
then i tried to use https://docs.google.com/gview?embedded=true&url=myfile.pdf. well and here i got troubles because there is some bug in in google docs because file displays only one in for times. the rest attempts ended with error code 200 from google. so as you already understood this is not a solution too.
then i tried to download php libs which should convert pdf to html (or image) but none of them worked beacuse i'm not that good at php and sometimes it asked to install third party libs so at this point i've failed too.
so now i'm stuck. i need to do something to display pdf on the page. i need some crossbrowser/responsive solution. it would be great if you help me to find some service like https://docs.google.com/gview which is gonna work without bugs or suggest any other solution. may be some small php lib with good documentation.
any help appriciated!
You can achieve by using PDF.js
https://github.com/mozilla/pdf.js/
for usage you can check this example http://mozilla.github.io/pdf.js/examples/index.html#interactive-examples.
I am looking for a javascript(better if based on jquery) Ajax image viewer with zoom feature that I can work on with php.
The best thing I found close to what I need was this great script:
thinDoc
You can view a demo here:
http://www.atalasoft.com/31apps/ThinDoc/
The problem with this script that it works only with asp not php. So if anybody can convert it to php that would be great. Or find a similar thing that I can use with php.
According to their documentation, you can just use their service without any server-side programming. Just embed your link to your pdf:
http://www.atalasoft.com/31apps/thindoc/?url=
Example:
For the pdf: http://lerdorf.com/veracruz.pdf
http://www.atalasoft.com/31apps/thindoc/?url=http://lerdorf.com/veracruz.pdf
It also works with images:
http://upload.wikimedia.org/wikipedia/commons/1/1b/Gardiners_Island_Windmill.jpg
becomes:
http://www.atalasoft.com/31apps/thindoc/?url=http://upload.wikimedia.org/wikipedia/commons/1/1b/Gardiners_Island_Windmill.jpg
I am currently working on a site that has to have the ability for users to view documents that are uploaded, however they need to be viewable in browser.
I know there is the Google docs viewer (however this does not seem to work when trying toopen it in a fancybox overlay), but are they any other alternatives, maybe some API's that could turn them into Flash or similar, and then I could simply embed it as a swf?
Any help would be greatly appreciated.
You said "however this does not seem to work when trying toopen it in a fancybox overlay" Did you tried with headers :
header("Content-type:application/pdf");
header("Content-type: application/vnd.ms-word");
For swf conversion see this
but are they any other alternatives, maybe some API's that could turn
them into Flash or similar, and then I could simply embed it as a swf?
Yes, there are APIs for converting word and PDF documents to Flash (swf). There is also a possibility to convert them to pure HTML so that the documents are shown directly in browser without Word or PDF software (Adobe Reader, etc.). Personally I use Print2Flash utility for putting my documents online. It converts my documents to both Flash and HTML formats at the same time. I do the conversion manually but there is an API for conversion as well as I can see here: http://print2flash.com/print2flashapi.php
I have two basic bar charts and I am currently using XML/SWF Charts which is great but the problem I have is I need to be able to send these graphs via email to the user. As well as display them on the site.
I know sending Flash is a bad idea, I would love to find a way to convert my current graphs to an image, but am pretty certain there is no quick fix without building a work around myself.
Therefore what are the best open source or closed solutions for this problem.
I need to be able to display two graphs dynamically and then email them to users.
Any advice is appreciated.
You may want to check out the "Google Image Chart Api" (not to be confused with the Google Chart API).
http://code.google.com/apis/chart/image/
It allows you to generate numerious different types of charts just from the URL.
For example:
https://chart.googleapis.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World
That URL could also be put into an HTML e-mail.
Alternatively, looking at this stackoverflow quesiton FLASH save frame, to image (tiff, bmp, jpg, gif, png)
If you can modify the flash movie. It appears that you can save frames in AS3 via BitmapData. So you may be able to send the data back to the server for processing (emailing). But I can't vouch for this as I haven't tried it.
jqPlot seems pretty good. Piwik uses it. http://www.jqplot.com/
I would recommend using gRaphael. It is a javascript library for rendering graphs using svg(or vml for IE8 and below). I've personally use it and it is quite good.
This probably won't work for you since you're not running .net, but for anyone else who's looking for resources for generating charts there's the MS Chart controls.
Is there a plain PHP implementation for decoding QR codes?
I have a faux-smartphone. One of those phones that parades as a smartphone but that I can't download any apps for, and I want to create an email service to where I can take a picture of a QR code, MMS it to this email, and the email returns what the QR code contains.
However, the only libraries I've been able to find are in Python (and probably C++), neither of which I can access on my limited hosting environment.
Is there a way to read QR codes using only PHP?
There is only one pure PHP QR code decoder. It's working with GD library, but can use also ImageMagick. This PHP QR code reader is ported from ZXing.
https://github.com/khanamiryan/php-qrcode-detector-decoder
I'm not aware of any pure php decoder. Decoding images like this is pretty processor intensive and doing it in a purely interpreted language is challenging.
zxing (http://code.google.com/p/zxing/) provides a decoder implementation in both Java and C++. In theory, it should be possible to link the C++ library as a php extension, though I don't know anything of the mechanics of that. I've done it for Ruby ...
Moreover, zxing does have an online decoder at http://zxing.org/w/decode.jspx. My thinking is that from PHP you can take the image and post it to the webservice and retrieve the decoded data. I don't know the mechanics of making remote web service calls from PHP and how different hosting environments might limit that, though, but it seems reasonable?
If you have the possibility to use a phpextension, php-zbarcode at https://github.com/mkoppanen/php-zbarcode can read qrcodes. It's a wrapper for ZBar from http://zbar.sourceforge.net, which in turn is a LGPL C library for decoding barcodes.
To decode your QR code you have to upload image of QR code and it will show you text inside that code image.
http://www.phpgang.com/how-to-decode-qr-code_344.html
Very easy to do tutorial I hope it helps.
Here is a good example & you can generate online direct QR code too...
there is also php library to implement QR code in your project.
http://phpqrcode.sourceforge.net/