I am trying to render an image with text and images that are on a .swf file. What i am doing is saving all the objects and their properties in an XML and then using imagemagick to render all that. the problem i am facing is that imagemagick treats fonts very different than Flash, so i don't get a perfect copy of what i see in the flash to what i see on the rendered image.
Can anyone share some light on how to match font sizes between flash an imagemagick? I would be very grateful.
Thanks!
Are you trying to save some image that you can see on the flash movie to a file? If so you can use Jpeg encoder in flash to do exactly that. Here is an example: http://designreviver.com/tutorials/actionscript-3-jpeg-encoder-revealed-saving-images-from-flash/
You still need a php or some other technology to post the data to and save it as a file so that the user can download it.
Related
While I was looking for some info, I came across this image on a forum which i didn't understood how it worked. Its a JPG image which actually tells you your ip address and your browser. I think that maybe it was made by modifying htacess and replacing PHP for JPG, and with PHP generating the image dynamically but I'm not sure about it.
Would this be the way that this works?
Here is the image i saw:
http://www.danasoft.com/sig/475388.jpg
Thanks
It is nothing but etching text on image. There are several options to do it. Using PHP see here and Java see here
yes this image is generating dynamically. It collects your info make a string and use some library to generate that image like in Captcha. php has its own library too for this purpose
Click here
I will create a dynamic page with content added and rearranged by JavaScript. Is it possible to create a jpg image of this content? - let's say, everything that is inside the container div will be generated to an image. If so, could anyone give me some good tips of this technique?
The traditional method is to run a "headless browser" on your server, "browse" to that url, and take a screenshot. It can be done to some accuracy on the client side in HTML5 browser, see this discussion:
Using HTML5/Canvas/JavaScript to take screenshots
This question may help:
Using HTML5/Canvas/JavaScript to take screenshots
and then this one:
convert canvas to jpeg image
The sequence of your algorithm would be something like:
create screenshot using canvas
convert the canvas screenshot to a
JPG file
I'd like to ask whether its possible to take a bit of CSS on a page with a PHP extension, and add the PHP header to define the page as a PNG, and have a dynamic image? From what I've heard this isn't possible, but if it isn't, is there a way easier than the conventional method of creating a PHP image?
Edit*
To elaborate, I want to do something like draw a bordered 200x200p box in CSS with styling and HTML, and have this HTML/CSS box on a .PHP page, and get this page to become a PNG image with the .PNG extension using the PHP header tag.
Thank You!
Karan
You can make use of wkhtmltopdf which can convert html to pdf using webkit (qtwebkit) which supports CSS properly. There even exists a PHP binding for it.
You can then convert the PDF file to a PNG (e.g. with ImageMagick) and serve it from within PHP.
Related: Website screenshots using PHP
If I understand your question properly, I am not sure how this would be possible using only PHP but you could use ImageMagick on server side to convert the HTML page to a png.
I'm trying to dynamically watermark a pdf file using PHP with Zend_Pdf.
Is there a way to de-layer a PDF file, put something (text, image) between the background and text layer, and then save it?
Is there like a z-index for PDF files?
Any help would be greatly appreciated.
Regards,
Paul
There is a type of Z-index but there's nothing that can actually manipulate it pragmatically. I've been trying to do similar for over a month.
I've tried: Zend, FPDF, AcroJS, PyPDF, ImageMagick and GhostScript with no luck.
The only way I've been able to add something "under" something else in a PDF is to rebuild it from the bottom up.
Example: I needed to add a photograph under an employee barcode.
First I cropped the PDF to the just the barcode (my_crop.py - Python)
Then I converted it to tiff copy (imagemagick)
Next I added the employee photo to the original PDF (Zend framework)
Finally I added the barcode tiff from the first step (Zend framework)
It's not in any way perfect but it's the only thing I could get anywhere near what I wanted.
I am working on a website in which the client wishes to have users upload background images to a printable design, crop to size, add text. Do this to multiple pages then generate a pdf of the 'book'
I am running into the following issues/questions and just need to see where I can start
Are there any PHP developer packages that can do something similar. I have seen jquery crop tools but something also for adding text to an image?
How would I keep the resolution up? If the final cropped with text image needs to be 150dpi, when cropping I am guessing I would have them working on a 72dpi image, then somehow apply the crop and changes to the large image?
If the resolution issue wasn't a big deal I would go about it this way:
Simple image upload
Use jquery to crop photo to correct dimensions
Mess around with gdlibrary and imagettftext() to get the text onto an image (page)
Use something like FPDF to create a pdf from each 'page'
Is this the right way to go about it and any thoughts on the resolution issue. Thank you for any help!
Your primary tool should be ImageMagick. ImageMagick can do the cropping, resizing, scaling, overlay text or graphics, combining images, and apply special effects. A big advantage of using a separate tool instead of PHP's image manipulation tools is that you can do the same transforms in batch through other mechanisms, or even hand the work over to another server to keep the website more responsive. And if you do want to integrate it tightly into the website, you can use the MagickWand For PHP interface.
Cropping does not change DPI, only the dimensions of the image. Scaling, on the other hand, changed both.
You should take a look at Gallery, a GPLed program with some of the functionality you're looking for, and written in PHP.
domPDF is a good tool for converting HTML to a PDF. this way you can use the image they upload as a background image, then put the text over it in any standard HTML tag.
As far as the resolution/dpi issue goes, I'm not sure if there is much you can do outside of changing the size of the image. I would recommend looking into This PHP Library, which has a lot of good tools for manipulating images.
I think with a combination of these tools, you'll be able to create HTML that can make a PDF that's fit to print, and use that.