I have a Dlink DCS-942-L webcam that will ftp one snapshot jpeg per hour to my website. It embeds them in a folder by date and then again in subfolders by hour according to time. I would like to display these pictures on a webpage. Any ideas would be appreciated.
If it was me I will put the images in the same folder than once a day. I will put in the image tags
<img alt="A description" src="images/myimage.jpg" width="200px" height="300px" />
There is no automatic way to write code to a webpage. If there was a way the website developers and designers will be out of a job. :-)
Someone might have created a C++, C#, or VB program to do this custom job. You might want to put javascript, C#, C++, and VB tags on this message so those groups can read this message
Related
I have a webform with and want to open it on smartphone - than take pictures of some documents which need to be merged in one PDF, and on the end this file need to be uploaded to server.
My solution is to use Google Drive to upload PDF (scan) to GDrive and then somehow download this file from gdrive to server via some sort of widget (any links appreciate) installed on website.
Maybe someone have a better idea?
I know its late but my answer might help others. I also face the same challenge and implemented a custom solution based on Javascript and Since you are using web form so this solution will perfectly fits on your need.
You have to use JSPdf javascript library, JSPdf provide you pdf object in your browser and you can upload it download it and there are many other thing to play with.
First you have to initialize JSPdf object as per your requirement. I am creating PDF with page size width:500px and height 500px.
pdf = new jsPDF("l", "pt", [500,500]);
Simply when you will take picture from camera you will have each picture in form of base64, that base64 format you have to insert in JSPdf object
pdf.addImage(imgData, 'JPEG', 0, 0);
you can repeat the above code to add pictures from camera as much as you want, at the back-end these images are compiling and creating pdf document where each page have each images in sequence.
Once you are done, you can get PDF object in form of base64 object using below code that you can upload to any server.
pdf.output('datauristring')
above is only pdf part, you can find complete working example including camera part here Javascript Component to Scan Document
I have a page that is dedicated to the Standard Operating Procedures (SOP). I want this page to show the the SOP in the page with a download button above it (and for Admin an upload button). Basically I want the user to be able to read the SOP without having to download it. I have the buttons sorted and I almost have the display set, but the format is off.
The admin can upload a PDF of the current SOP. That file then gets stored and overwrites that last upload. I tried using cffile but it was unreadable no matter what charset I tried to use. Currently I am taking the file and extracting it as a .txt, then using cffile to read it to a variable that I then output to the screen. It sort of works, but the formatting is all wrong.
I know I can use cfcontent and just have the page be the PDF, but I'd rather not have to mess with adding a new page just for admins to upload new SOP files. (The way the site is built it would have to be a new page)
<cfpdf
action="extracttext"
source="D:\file_path\SOP.pdf"
overwrite="true"
honourspaces="true"
type="string"
useStructure="true"
destination="D:\file_path\SOP.txt">
<cffile
action="read"
file="D:\file_path\SOP.txt"
variable="dcnSOP">
...
<cfoutput>#dcnSOP#</cfoutput>
Basically I'm getting a block of unformatted (as in spaces and new paragraphs) text. It's the text I want, and It's on the page where I want it. But it looks terrible. It seems to just be getting rid of any new line characters and just presenting the text in a blob. Is there a better way of doing this without just having the whole page be the PDF using cfcontent?
Thanks to #Miguel-F and #Ageax for the suggestions and leading me to a question I missed on here when I was searching for the answer.
<embed src="\file_path\SOP.pdf" width="800px" height="2100px"/>
This works with every browser but Chrome (our clients will not be using mobile browsers). I know you can use Google's PDF reader to get around this, if anyone is interested in that here is an example of that given by #Script47 here:
<embed src="https://drive.google.com/viewerng/
viewer?embedded=true&url=http://example.com/the.pdf" width="500" height="375">
I've been trying to figure this one out for about a week now and just
can't come up with a good solution. So, I figured I would see if anyone could help me out. Here's one of the links that I'm trying to scrape:
http://content.lib.washington.edu/cdm4/item_viewer.php?CISOROOT=/alaskawcanada&CISOPTR=491&CISOBOX=1&REC=4
I right-clicked to copy image location.
This is the link that is copied:
(Can't paste this as a link because I'm new)
http:// content (dot) lib (dot) washington (dot) edu/cgi-bin/getimage.exe?CISOROOT=/alaskawcanada&CISOPTR=491&DMSCALE=100.00000&DMWIDTH=802&DMHEIGHT=657.890625&DMX=0&DMY=0&DMTEXT=%20NA3050%20%09AWC0644%20AWC0388%20AWC0074%20AWC0575&REC=4&DMTHUMB=0&DMROTATE=0
There is no clear image URL being displayed. Obviously that's
because the image is hidden behind some type of script. Through trial and
error I found that I can put ".jpg" after the "CISOPTR=491" and then the link becomes an Image URL. The problem is that this is not the high-resolution version of the image. To get to the
high-resolution version I have to change the URL even more. I found a lot of articles #Stackoverflow.com to mention trying to build a script using curl and PHP, I have even tried a few of them with no luck. "491" is the image number and I can change that number to find other images in the same directory. So, scraping a sequence of numbers should be pretty easy. But I'm still a noob at scraping and this one is kicking my butt. Here's what I've tried.
Get remote image using cURL then resample
also tried this.
http://psung.blogspot.com/2008/06/using-wget-or-curl-to-download-web.html
I also have Outwit Hub, and Site Sucker, but they don't recognize the URL as an image file and fo they just pass right ove it. I used SiteSucker overnight and it download 40,000 files and only 60 were jpegs, none of which were the ones I wanted.
The other thing I keep running into, is the files I have been able to download manually, the filename is always either getfile.exe or showfile.exe and then if I manually add ".jpg" as the extension I can view the image locally.
How can I reached the original high-res image file, and automate the download process so that I can scrape a couple hundred of these images?
I right-clicked to copy image location. This is the link that is
copied:
You noticed the title has ".exe" in there. Look at the stuff in the query string:
DMSCALE=100.00000
DMWIDTH=802
DMHEIGHT=657.890625
DMX=0
DMY=0
DMTEXT=%20NA3050%20%09AWC0644%20AWC0388%20AWC0074%20AWC0575
REC=4
DMTHUMB=0
DMROTATE=0
Strongly implies the original source of this image is in a database or something and it is being passed thru a server-side filter (not sure if that is what you meant by "some kind of script"). Ie, this is dynamically generated content, not static, and the same caveats apply as would to dynamic text content: you have to figure out what instructions to provide the server to get it to cough up what you want. Which you pretty much have in front of you...if SiteSucker or whatever won't deal with it properly, scrape the address yourself using an HTML parser.
I'm trying to convert an entire presentation to HTML, extracting all the embedded content etc along the way. I've got text, audio, narrations etc all working fine but am having trouble finding out how to export video content.
Im looping through all slides in the presentation, then all shapes on the slide, looking for shapes of type msoMedia. If I find one, then I check it's MediaType. If it's ppMediaTypeMovie, then I can find the source file of an externally linked video file using Shape.LinkFormat.SourceFullName, but I can't for the life of me find out how to access EMBEDDED content.
If I find a shape with a MediaType of ppMediaTypeSound then I can use Shape.SoundFormat.Export to export the audio. Does anybody know of an equivalent for VIDEO shapes? (There's no Shape.VideoFormat) I've spent days looking through every possible data member I can but to no avail.
It appears Microsoft extract the contents of the media file to a temporary folder anyway, and embedded videos still provide a LinkFormat.SourceFullName to the extracted video:
?oshape.LinkFormat.SourceFullName
C:\Users\Alex\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.MSO\F26FF1D0.m4v
All that I need to do is fire this file through ffmpeg and I've got my video, in the format I want!
Thanks for your help :)
Note: You may find that the .Export method doesn't work for embedded sounds either in recent PPT versions.
Alex's suggestion is what I'd look into first; otherwise you can unzip the PPTX/PPSX/etc and find the videos in the media folder. Or you might try saving as an XML presentation; you might be able to parse the video out of that.
I watched the traffic when google displays PDF attachments in gmail in a new window. The content is served as PNG images for each PDF page. And its text can be selected. What does google use on server side to generate a PNG file for a particular page in a pdf file? How does the selection of text on a png file work? Any ideas?
By default attachments are viewed securely using https://docs.google.com/gview, however it turns out you are allowed to request files over plain HTTP. This makes it a little bit easier to figure out what is going on using Wireshark.
As you indicated it was already clear that the PDF is converted on the server side to a PNG (ImageMagick is indeed a reasonable solution for this purpose), the obvious reason for this is to preserve the exact layout while still being able to view the file without requiring a PDF viewer.
However, from looking at the traffic I found out that the entire PDF is also converted to a custom XML format when calling /gview?a=gt&docid=&chan=&thid= (this is done as soon as you request the document). As I couldn't use Wireshark to copy the XML I resorted to the Firefox extension Live HTTP Headers. Here's an excerpt:
<pdf2xml>
<meta name="Author" content="Bruce van der Kooij"/>
<meta name="Creator" content="Writer"/>
<meta name="Producer" content="OpenOffice.org 3.0"/>
<meta name="CreationDate" content="20090218171300+01'00'"/>
<page t="0" l="0" w="595" h="842">
<text l="188" t="99" w="213" h="27" p="188,213">Programmabureau</text>
<text l="85" t="127" w="425" h="27" p="85,117,209,61,277,21,305,124,436,75">Nederland Open in Verbinding (NOiV)</text>
</page>
</pdf2xml>
I'm not quite sure yet what all the attributes on the text element stand for (with the exception of w and h) but they're obviously the coordinates of the text and possibly length. As the JavaScript Google uses is minimized (or possibly obsfuscated, but this is not likely) figuring out precisely how the client-side selection function works is not quite that easy. But most likely it uses this XML file to figure out what text the user is looking at and then copies that to the user's clipboard.
Note that there is an open source (GPL licensed) tool called pdf2xml which has similar but not quite the same output. Here's the example from their homepage:
<?xml version="1.0" encoding="utf-8" ?>
<pdf2xml pages="3">
<title>My Title</title>
<page width="780" height="1152">
<font size="10" face="MHCJMH+FuturaT-Bold" color="#FF0000">
<text x="324" y="37" width="132" height="10">Friday, September 27, 2002</text>
<img x="324" y="232" width="277" height="340" src="text_pic0001.png"/>
<link x="324" y="232" width="277" height="340" dest_page="2" dest_x="141" dest_y="187"/>
</font>
<font size="12" face="AGaramond-Regular" italic="true" bold="true">
<text x="509" y="68" width="121" height="12">This is a test PDF file</text>
<link x="509" y="68" width="121" height="12" href="www.mobipocket.com"/>
</font>
</page>
</pdf2xml>
Hope this information is in any way useful, however like one of the other posters mentioned the only way to be sure what Google does is by asking them. It's a shame Google doesn't have an official IRC channel but they do have a forum for Google Docs support questions.
Good luck.
Google uses a non-open-sourced PDF converter app developed in-house. So you're better off looking into the links posted by other answers, since you can't get your hands on the Google version. Sorry!
if you have the text you can make it what you want offcourse,
more specific you should check out this link : pdf to png using php
so imageMagick will be needed imageMagic
edit : another interesting link.
edit : i found this at google, it looks interesting ... so you could use the google api
Google Document List Data Api and this is a blogpost about it Google API Now Lets You Get Documents in Many Formats
Offcourse to be sure what google uses you need an answer from them ? :)
good luck !
To see what a pdf is created with, right click on it and go to the Document Properties (in Adobe reader). The PDF producer will show up as the "PDF Producer". I think google uses both Prince and IText (not in combination for creating PDFs). Google has created some major modifications on the above toolkits to create that end product.
Well.. this might just be the pdf2xml tool Google is using. They only changed they full words width, height etc and they added the p attribute... which turns out to be the attribute containing the coordinates for the words inside the line. Just played with it and found out :) Going to use this pdf2xml from google :P Upload, let them convert... use xml to transform tooo... epub? :P
You may also want to investigate use Lucence to index those big pdf files and serve related pages to your users.
See http://www.jguru.com/faq/view.jsp?EID=1074237 for more ideas.