Insert image in PDF file - php

I need to insert an image in a PDF file on a certain page, in a specific location. How could I do that in a way that would work on a server. I'm looking for a command-line application, windows if possible. Any ideas?
Thanks

Related

using ffmpeg and automate it to create video

I want to create a video from images on the server. I have a css animation on the webpage. I've already written a code that takes screenshots (with dataURL base64) and save them in a folder on my server (using html2canvas/ajax/php). All the images are also created as "image001.png, image002.png etc". Once I have all the files in my folder I would like to use ffmpeg to grab all the images and convert in a video. But I want this step automated and I am not sure how to do it. Using a php code with condition (example if all the files are in the folder) with a shell_exec() ? I am a bit confused on how to mix javascript php ffmpeg.
Thanks

Save user uploaded file to server using Python

I have a small drag and drop file upload app that I was looking to rewrite using Python on App Engine, and plan to save files on Google Cloud Storage. The problem is, I can't figure out how (or if) I can save files in Python. Currently, when the user drags a file into the upload area, Javascript acts on it and sends it off to a PHP file. There I can then save the file to a specific directory on a server by doing something like this:
$tmp_name = $_FILES['file']['tmp_name'];
$name = $_FILES['file']['name'];
move_uploaded_file($tmp_name, getcwd()."/".$name);
My question is, can I use Python to replace the PHP? If so, what am I looking for, as I haven't been able to find anything on this topic. I understand that I cannot save files to App Engine and will be using Google Cloud Storage. How can I do this? Is there a generic way to do this assuming I'm on my own server? Thanks!
Edit: Ignoring the drag and drop portion, can I simply use html to have users browse for a file on their desktop but use Python to take that file and save it somewhere?
As mentioned you wont be able to save the file to the filesystem but you can store the file in the datastore (1Mb limit) or the blobstore (32Mb limit?).
This link provides an example on using the blobstore to upload a file https://developers.google.com/appengine/docs/python/blobstore/#Uploading_a_Blob

how to generate screenshot/thumbnail (take photo) on swf files

I'm writing arcade game script. i want to take a photo for thumbnail on swf files.
have php got function for this?
Or How difficult?
Upload a swf file
Take a photo uploaded file
Move directory
Add to mysql
That's not possible with PHP alone. The best solution in my eyes is to use a browser screenshot tool on a page that embeds the flash.

writing a .exe file to write text file to client-side in php

I would like to write a file to the client-side in php.
The problem with php is that it will only write in the server-side.
I need help because i dont know how to do it.
What I have:
Whenever a client clicks a link to a page it will run the script that will write to a text file which contains a query results from a database known as a flatfile. But it is not possible for client-side in php.
What I need:
Whenever a client click the link, it will download a .exe file.
In the .exe is the php script that will write a file to the client's hdd.
After the .exe file is downloaded, it will automatically run and create the file on the path specified.
Please, I need help to finish my education.
Why not create the file on the server side and serve it via a URL? The user can then save it to their computer. If you tried to send an EXE file, the user would have to save that, anyway, and they'd be much less likely to actually want to do it!

Online Image Slideshow Question. File Access Problems

I have a flash .swf file that I embed on my webpage. On my server I have the .swf file and multiple image folders. I would like to load every file in one of those folders into the flash slideshow. How should I go about doing this? I tried used Air but it doesn't work on my system as an application so I doubt it will work online. Eventually I plan on making a menu where you can select different folders to display and since they are of different sizes, a foreach loop would be optimal. Keeping a txt file with the number of images is also possible if theres a way to read that in, but I would prefer the more dynamic approach. I am working towards using php for the website if that helps find a solution.
Thanks,
-Mike
Also my slideshow works great online currently but i have to hardcode in the number of files.
I would suggest to have a PHP script on your server that takes care of parsing those folders, and return the list of files to Flash (with a valid public URL).
Basically at your application startup, you would call the PHP script to retrieve the full list of file (XML is a good format to be returned, or AMF if you have a lot of folders/files).
After all you have to do is manipulate that data to load whatever folder/files the user is willing to see.
Just for your information, Flash doesn't have access to the Filesystem, so it's impossible to parse folders directly from Flash. (However It is possible with an Air Application)

Categories