How to apply Style and effect on ink filepicker through Javascript - filepicker.io

I am stucked on filepicker.io API from long days that how do i add style/css through javascript in ink filepicker.
I have also idea about i can add style to my ink filepicker from my account also but i have two filepicker.io on my same page i just want to change style for only one dialog so is there any way to do it.
filepicker.pick({ mimetype: "image/*" }, function (InkBlob) {
json = InkBlob;
var InkbolobFilename = json.filename;
var InkbolobUrl = json.url;
});
This my code snap so please help me out where i can add my css url.

Related

How do I set an image for Facebook to use in links to Mediawiki pages

Links from Facebook to my Mediawiki-powered website show an ugly default image for links. (The squarish image which shows a truncated "Powered by Mediawiki") pointed to by the gray arrow.)
How do I override this? I'm looking for a single image which would be the same for all pages rather than a custom image for each page. I want to avoid adding extensions if possible!
Added: #wgLogo is set and the logo file thus set does appear on the individual pages, but not on the FB link.
It seems that the secret is to set <meta property='og:image'… on every page (https://developers.facebook.com/docs/sharing/webmasters/images/).
To do so without installing extensions, add to your LocalSettings.php:
$wgHooks ['BeforePageDisplay'] [] = function (OutputPage &$out, Skin &$skin): bool {
$out->addMeta ('og:image', '(path to your image)');
return true;
};
Further reading:
https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay
https://doc.wikimedia.org/mediawiki-core/master/php/classOutputPage.html#a1d667167a39be62f9988e94256508489
The PageImages extension adds the most prominent image used on the page as the OpenGraph image. The WikiSEO extension lets you set it manually (per-page or sitewide).

How to render partial content of a website in Flutter?

I am new to Flutter and I would like to render a partial content from a website in my Flutter application. Imagine this as an example: I want to render the main content of this website: https://flutter.dev/. I could obtain this content by executing the javascript command: document.getElementsByClassName("container")[0] .
What do I have to do to display this content in an WebView inside my Flutter application?
Thank you
This answer demonstrates how to pass html content to a Webview plugin in Flutter.
In your case you dont need to read from a file as in that answer, just pass in the String that you obtain from whatever means you need to use.
The relevant part of that answers code for you is:
String fileText = await rootBundle.loadString('assets/help.html');
_controller.loadUrl( Uri.dataFromString(
fileText,
mimeType: 'text/html',
encoding: Encoding.getByName('utf-8')
).toString());
where in your case the fileText String is the html content that you got from somewhere.

Facebook error when pulling og:image

For whatever reason, the image that I'm trying to use when sharing a link on FB doesn't load. The exact error that's being given is this:
Provided og:image, could not be downloaded. This can happen due to several different reasons such as your server using unsupported content-encoding. The crawler accepts deflate and gzip content encodings.
I'm using an s3 bucket to hold my images, and as far as I'm concerned the bucket is public and I can load these images on any browser. I'm also adding the og:image, og:image:url, og:image:secure_url, og:image:height, og:image:width, and og:image:type to the meta tags, so as far as meta tags are concerned I think I've covered all grounds. Is there a particular setting that I should be adding? Thanks of any help
For other people who end up here, I encountered this issue temporarily. The Facebook Sharing Debugger fetches images asynchronously and can give false 404s.
I recommend scraping again a couple of times to confirm.
After some time I was able to solve the problem. It turns out, the FB Sharer doesn't accept base64 images. What I was doing was directly saving the base64 binary to S3, and because of that FB couldn't display the image.
So if someone out there is doing the same thing as I was, save your base64 images to file/directory first before uploading it to S3.
In my case, this was due to the Extension of the Image.
I changed .PNG to .JPEG and it starts working.
So please try to change your extension and then try again.
At first I convert HTML to canvas, then canvas to image and afterwards this image is drawn with canvas for cropping the initial image to get rid of extra space. After this is done, the image is sent to the server for storage and passed to FB in og:image meta tag.
$scope.facebookShared = () ->
$window.open "//www.facebook.com/sharer/sharer.php?u=" + encodeURI($location.absUrl()), "sharer", "toolbar=0,status=0,width=" + 500 + ",height=" + 500 /// this is window for share fb
height=$('.sharing').height()
html2canvas document.body,
onrendered: (canvas) ->
context = canvas.getContext('2d')
image = new Image()
image.src = canvas.toDataURL("image/png")
image.onload = ->
sharing=$('.sharing')
canvas.height = Math.round(sharing.width()/1.91)
canvas.width = sharing.width()
context=canvas.getContext('2d')
pos = sharing.parent(0).parent(0).position()
context.drawImage(this, pos.left, pos.top, sharing.width() + 20, sharing.height(),0,0,sharing.width()+20,sharing.height())
$.ajax
url: '../../save_img'
type: 'post'
beforeSend: (xhr) ->
xhr.setRequestHeader "X-CSRF-Token", $("meta[name=\"csrf-token\"]").attr("content")
return
data:
base64_image: canvas.toDataURL("image/png").replace(/^data:image\/(png|jpg);base64,/, "")
claim_slug: $scope.claim.slug
return false
width: $('.claim-page ').width()
height: height+115
return

html2canvas: render same origin iframes

I am trying to take a screenshot of a div on my webpage using html2canvas.
In the html2canvas documentation it is stated that:
The script doesn't render plugin content such as Flash or Java applets. It doesn't render iframe content either, unless the content resides under the same origin.
My div contains same-origin iframes, but the iframes dont appear in the screenshot.
My script:
$('#savetopdf').click(function () {
html2canvas($('#dashboard'), {
"logging": true,
onrendered: function(canvas) {
var img = canvas.toDataURL()
window.open(img);
}
});
});
Unfortunately this is not implemented, any more.
I had the same issue and submitted it as a bug/feature request.
https://github.com/niklasvh/html2canvas/issues/376
The owner of the project stated:
niklasvh
There is currently no support for rendering iframe's even if the reside under same origin.

How can I view a PowerPoint in an ASP.NET application?

Does anyone have a PowerPoint viewer which I can embed in an ASP.NET Web App?
If you are using Silverlight you can use
http://pptx2silverlight.codeplex.com/
You can't directly embed a PPT/presentation to view. Instead you can try any converter that allows you to embed the PPT slide as images or some other format that the client browser can render to the user. There are few products like GroupDocs viewer or Doconut viewer that do this. You can give it a try.
You will have to convert the PowerPoint slides in the form, i.e. images or HTML pages, that can be embedded in your web page. You may try GroupDocs.Viewer for .NET that allows rendering the presentation slides into high-fidelity images (PNG/JPG) or the HTML pages. You can then embed the rendered pages into your web page to preview the slides. This is how you can render the slides:
Rendering as Image:
using GroupDocs.Viewer.Options;
// Set output path
string OutputPagePathFormat = Path.Combine("C:\\output", "page_{0}.png");
// Render document pages
using (Viewer viewer = new Viewer("C:\\sample.pptx"))
{
PngViewOptions options = new PngViewOptions(OutputPagePathFormat);
viewer.View(options);
// Rendered images will be saved in the D:\output\ directory.
}
Rendering as HTML:
using GroupDocs.Viewer.Options;
// The file path format
string OutputPagePathFormat = Path.Combine("C:\\output","page-{0}.html");
using (Viewer viewer = new Viewer("C:\\sample.pptx"))
{
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(OutputPagePathFormat);
viewer.View(options);
}
Disclosure: I work as a developer evangelist at GroupDocs.