How to get `thumbnails document` like google doc? - php

How to get thumbs document (doc, docx, pdf, pptx, ppt,.....)?
May be use C#, php, .....
Please help me!
Thanks you very much!

This has been asked before ... please see Live Thumbnails/Large Image for some examples
It only capture web sites but its the same for every other document types .... all you need to do is convert (doc, docx, pptx, ppt,.....) to pdf or HTML or image ... PDF is easier to work with but some online tools can also convert doc to image directly ..
When you have it pdf you can easy convert it to jpg then create a thumbnails form jpg
See more tools you can use
See
http://www.imagemagick.org/www/formats.html
exec("convert sample.pdf sample.jpeg")
See
http://www.phpclasses.org/package/5846-PHP-Convert-PDF-documents-to-images-using-Ghostscript.html
See
How do I convert a PDF document to a preview image in PHP?
I hope this helps
Thanks
:)

Related

PHP mPDF base64 image error - could not find image file ()

According documentation I would like to use mpdf with base64 image to preview img tag in document. Everything should be ok, if I show the base64 image in html page it wortks fine. But mpdf throws me an error:
Could not find image file ()
The code looks like this and as I said in html it works but not in mpdf:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG8AAA....."
Can somebody tell me please what is wrong? Documentation is simple. Why mpdf does not recognize base64 data? Thanks for any help.

PHP::Imagick Creating a Temp FIle from A Composite Image, for displaying through <img> Tag

Is it possible to create a temp file server side for viewing an image?
I've some images & they're displayed from server but I want to have them watermarked... Found out about the Imagick Class, used composite... It can be viewed when sent as header but I need it somehow visible for the tag.
I don't want to uses 'write image' & create a new image from the composited image. I'm trying to use it as client Side thing (I'm not familiar with JS... Yes, I'll look into it but need an alternative till then).
Another alternative that I'm aware of is I should control that WHILE uploading the images but I've already uploaded quite a few so...
Any help appreciated!
Have you tried using the function that generates your image as a src attribute for the <img /> tag?
I don't know exactly how your code is, but I am thinking the end result could be something like:
<img src="data:image/jpeg;base64,<?php echo base64_encode($image_headers); ?>">
You basically output the headers inside the image src as a base64 encoded string.
What you should keep in mind is that you should adjust the image/jpeg type to the corresponding type of your image.
For example:
For JPG, JPEG files it would be image/jpeg
For PNG files it would be image/png
For WEBP files it would be image/webp
And of course the encoded string should be an image of the corresponding format.

prevent automatic file download and display file in php form using iframe

I need to display doc or docx or pdf kind of file in php code.Here is my code,
<iframe src="http://localhost/sample/sampl1/resource/upload/resumes/1406263145_resume sample.docx"
style="width:820px; height:700px;" frameborder="0"></iframe>
in localhost...
When i load the form,the given docx file is downloading automatically and the file is not view in a php form...So any one can help me?
To view document files (doc, docx, etc), you can use either the Zoho Viewer or Google Docs Viewer jQuery plugin.

svg to image on demand

I have javascript code that generates svg image tags on the fly when a person lands on one of the pages. Im using the d3 library to help make the image. The only problem is that d3 is not fully IE compatible and I would want to generate a .png, jpg, gif or any other image file based on the svg file. Is there a known way to do this?
The server side code is PHP based, and we use node.js, and render.js for a lot of the dynamic content.
I'm using ImageMagick to convert SVG images to PNG images.
This works pretty well.
A quick example of how to do this:
exec('/usr/bin/convert /path/to/image.svg /path/to/output_image.png');
I'm using this with great success for processing QR codes made with libqrencode to different sizes and colors.
Firstly you need to use a DOM implementation on server side as you want to get svg which is rendered on client side.For this we use jsdom with node.js.
Using this you can render D3 on server side and get svg on server then convert it to any format you like.
Here is the link on how to that.
Once you got SVG and PNG then by using modernizer.js
1)Check compatibility of browser using Modernizr.
2)Then load SVG or PNG basing upon on the compatibility.
Example (JS solution):
if (!Modernizr.svg) {
$("#logo").css("background-image", "url(fallback.png)");
}
Example (CSS solution):
.no-svg #logo { background-image: url(fallback.png); }

Converting google map to pdf in php

I am using TCPDF for generating PDF documents and i want to convert a google static image map into my pdf. How can i achieve this, some examples?
Why don't you try static google map to embed map in pdf. Static map generate image file which will easily added thorough document. I haven't tried but it should work...
For more detail see http://code.google.com/apis/maps/documentation/staticmaps/
Build the google static map link, docs can be found http://code.google.com/intl/nl-NL/apis/maps/documentation/staticmaps/
Use the writeHTML method of TCPDF to write the following:
<img src="http://yourgooglemapurl.com"/>

Categories