Adding downloadlink using canvg and amcharts - php

I am trying to add a downloadlink to a page that uses AmCharts and CanVG.
The entire graph and img displaying part is all working correctly.
Now i need a downloadlink to provide the user with the image of the graph displayed.
i have already tried to create a HTML link element to the image, but at that moment, i get an error that says "Requested URI to long".
Also i have tried using a form, parsing the source from the image(obtained via jQuery) to a new page, and displaying it there, but also that won't work..
Anybody that can help me? every solution using html/php/jquery/javascript is perfectly fine.

As i have found out, this is not possible due to the length of the url. The best solution will be just to display the image in a div, next to the chart or underneath the chart, as a thumbnail. Trough there the user can just save it into their documents.

Related

Getting Thumbnail from an external URL

I need to retreive image from an external link using php. I am not interested to use services like Embed.ly
I tried this one: https://www.webslake.com/article/generating-link-preview-using-php/
But it failed to get the image. Just showing the alt text.
Please help me to solve this problem...
Your code is looking for an og:image or twitter:image meta tag, and then (as a fallback) for large image tags.
Twitter.com has none of these if you view the source as a logged-out user. There's no image for your code to fetch, so it fails to do so. This won't be uncommon, so it'd be best to have a "if no image is found" fallback in your code.

FB Share pop-up different window than what is posted

I'm new to using the FB share buttons terminology so forgive me if I use the wrong syntax in describing this.
My site is setup to load pages based on the passed parameters in the URL (...?page=somepage&imageid=idnum).
So I have my index file which contains my head, as well as sidebar, etc. Then my main body is generated according to the passed parameter. Simple Enough.
On the homepage, the main body is a gallery of images. When they click on one of those images it takes them to a page that just displays that one image. The page is loaded with parameters of ?page=detail&image_id=1 /*or whatever the id of that image is */
So when they click on the share on FB button on those individual images page, I would like it to populate with the image that is displayed on that page. What I have done is included a php file in my head tag. The php script included gets the page info and passed parameters and then fills out the image url based on the imageid.
echo '<meta property="og:image" content="http://www.chiseledimages.com/clients/vote/'.$imgurl.'"/>';
This works in that when displaying the page source, the meta tag with og:image shows perfectly, also in that when I run it through the FB Object debugger, it gets the correct image and doesn't show me any errors. It even posts the correct image when the users shares on their wall. What is does not do, is show the correct image in the pop window after the uses presses the share button on my site. So even though the result is what I want, the problem with the user not seeing the correct image in the share pop-up, may lead them not to want to share on their wall.
Current location of site: http://www.chiseledimages.com/clients/vote/
Example of a specific pages: http://chiseledimages.com/clients/vote/?page=detail&angel_id=1
Screenshots of pop-up with wrong image, but final posted story having correct image.
How can I make the image in the pop-up match the image that is going to be shared. Thanks.
Edit: I forgot to mention and I'm sure it matters that I'm using Addthis to implement the FB share.
Check https://developers.facebook.com/docs/reference/dialogs/feed/ - look for the 'picture' parameter description
I suggest to you use this http://support.addthis.com/customer/portal/articles/1365475-attribute-based-configuration#.UwPQB6LW6So. just follow their example and you good to go.

How to embed a php graph in a web-page

I am using this script which is one of the examples provided by the graph itself. When I put this on a web-page by itself, it's drawing the graph. But when I embed the code in an already existing web-page (with some content), it doesn't draw a graph.
I did the experiment using img src and its working fine.
But I just wanted to submit some parameter along with that graph in same web page.
How do I do that one without using "img src"?
Thanks in advance
but i just want to copy the total graph code in my exist php script
Better don't. It's best to just use an <img> element to embed the graph. Use GET parameters to pass values:
<img src="script.php?param1=123456&param2=124050">
Creating inline images is theoretically possible using data: URIs, but it's not fully supported by Internet Explorer yet.
You can do this by generating new CSS or by using javascript.

Any way to make image (gd lib) show only on specific page only?

I'm trying to figure out the logistics for a new site that I'm creating, and one of the main issues is to get verification working correctly. One of the verification methods i'd like to incorporate is for a specific image (created via gdlib on the fly) to only work on a web page that is specified in a database field. If the image is shown on the EXACT page that is specified, then it shows the correct image, and if the link is incorrect, then it shows a different image (set by admin). The fields will be created on the admin side, and I'm trying to figure out how to get multiple instances of this working correctly. I'm using PHP and using a tag like [img src="something_here.php"] to show my images. Any suggestions on how to set the coding to verify the site that the image is embedded into?
Update So I got it working, but the request_URI command only works for the extension "ex. login.php", as opposed to adding in the absolute domain also. Any suggestions on how to make it factor in the whole domain address?
If you create an image with gd, you can put any PHP code on the page. for example: if ($_SERVER['REQUEST_URI'] == '/specialWebPage.php') { ... }.

Image layers cufon jquery php saving the resulting composite?

This question is a bit open at the moment as I'm not sure the idea is even possible.
So far I've loaded an image from a url, and then used jQuery UI draggable feature to allow the user to drag html text (which has been replaced using cufon font replacement) over the top of the image.
The major step (which is what my question relates to) is being able to take the image and text layered over the top of the image, and save the result, either to the server, or potentially offer the option to save the altered image to the user's HD, or what would also be useful is to upload to facebook using the facebook API, but this is something I know is possible.
It all hangs on whether it's even possible to achieve the first step, which is to save the image and layered text as a combined image?
I wonder if there is a PHP/jQuery solution that would allow me to do this?
My suggestion would be to have an internal URL that outputs the final image using jQuery and PHP, then take a screenshot using webkit2png of that page. You should know the dimensions etc., so you'll be able to crop down the resulting screenshot to just the region you're looking for.

Categories