Yandex API to translate PDF and return translated PDF? - google-translate

I have used the yandex translate api to translate strings and it works just fine, just wanted to confirm if there is any way to send a pdf file with the post request and in response get a pdf file or html, like in the demo ? Yandex Translate API OR does the google translate api support document files this link suggests that it is not supported yet.

Figured it out! well.. we did not use the yandex api, instead we used python pdfkit to convert the pdf to html, (css, html, images and js separately), then used the google tranlate api post call to translate the html and convert that back to pdf.

Related

Having trouble Embedding a specific Vimeo Url

I used to embed Vimeo videos with this url format: https://vimeo.com/514607003 (only numbers). It works just fine. But some videos are in an other format and I cant embed them no matter what:
https://vimeo.com/605783608/493d2ee578
I'm getting this error on console when I try to embed it:
GET https://player.vimeo.com/video/605783608 404 (Not Found)
when I add the second Id of the video Url to the embedded Url, the error remains the same.
The answer appears to be to embed the video with a special query parameter h containing the second key:
https://player.vimeo.com/video/605783608?h=493d2ee578
This is determined by looking at Vimeo's own embed code; I did not find documentation explaining why this is.

Export ng-Grid to csv not working in IE

Tried to implement export ng-grid to csv functionality using the ng-grid-csv-export plugin. But it did not work for IE.
Next, followed this blog. It uses node.js on server to return csv from webservice, however, we don't have access there.
Then followed this post to implement the form action for IE. However, this does not work as downloadCsv function is not getting called.
Please let me know if I'm missing out on something and request you to please post an example of a URL which accepts a POST request with JSON encoded object in the payload and return a CSV.
IE doesn't support the data URI link.
I got around the issue by detecting IE and falling back to an iFrame solution and using document.execCommand
Details can be found here.
https://stackoverflow.com/a/26003382/378151

Google Doc Viewer: Which formats are really supported?

I'm using Google Docs Viewer to embed all kind of documents. However I am having trouble to find out which formats are really supported.
On the offical Docs Viewer website (https://docs.google.com/viewer) Google links to a nice list of all supported formats. The following formats should be supported:
Google Docs
Google Sheets
Google Slides
Google Forms
Google Drawings
Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
Raw Image formats
Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV, .ogg)
Microsoft Word (.DOC and .DOCX)
Microsoft Excel (.XLS and .XLSX)
Microsoft PowerPoint (.PPT and .PPTX)
Adobe Portable Document Format (.PDF)
Tagged Image File Format (.TIFF)
Scalable Vector Graphics (.SVG)
PostScript (.EPS, .PS)
TrueType (.TTF)
XML Paper Specification (.XPS)
.MTS files
However, if I try to embed Image files or Video files for example I will get the famous 'Sorry, this type of document is not supported for viewing' error.
So my question is: Why doesn't it show these files and which formats are really supported?
Example: JPEG (not working)
https://docs.google.com/viewer?embedded=true&url=http%3A%2F%2Fwww.fnordware.com%2Fj2k%2Frelax-orig.png
See for more examples: http://jsfiddle.net/ABcz6/
Yes, I can confirm that JPGs as well PNGs that I tried did not work. Originaly I was trying to view such files with Drupals Embedded Google Docs Viewer, but then tested with just the URL https://docs.google.com/gview?embedded=true&url=http://www.example.com/test.jpg.
BUT, the semi-good news is that you can use TIFF images instead.
Maybe TIFFs are just more office-stylee :D

A "shortcut" method for exporting an ASP.Net Page to pdf/xls

I want to export a few Pages to pdf/xls. By Pages I mean as the eye sees it - a screenshot of the Page's contents. I know how to build pdf/xls documents using 3rd party tools but is there any way to quickly export the rendered contents of say a Panel?
edit: maybe a tool that can render the page's output as a browser would, and save it as an image file?
There is an open source console program named wkhtmltopdf which you could call from asp.net to convert the page. It can convert to PDF or an image with wkhtmltoimage (JPG, PNG, etc.) using the webkit rendering engine.
Check my answer to this question to see an example of how to convert from a html to a pdf using C#:
Easiest way of porting html table data to readable document
I can recommend http://www.screengrab.org/ for firefox.

How to post a comment on photo or video?

How to post a comment on image or video, using the graph api?
And how to post an image, using the graph api?
I am trying to code like this, using this URL but it's not working properly:
https://graph.facebook.com/page_id/feed?acess_token=tokengenerated&method=post&picture=Image/photo1.bmp
Does it require to add # character ?
If I add it, it still doesn't work properly:
&picture=#Image/photo1.bmp
It gives me an error stating that the picture URL is not properly formatted.
https://graph.facebook.com/page_id/feed?access_token=tokengenerated&method=post&picture=Image/photo1.bmp
Might it be a spelling mistake:
acess => access

Resources