I'm developing a Firefox Addon which has this functionality to copy an image to clipboard.
I'm using require("sdk/clipboard") lib, as described in the documentation
But when I try to attach a base64 image, it gives me the following error:
JPM [error] Message: Error: Invalid flavor for image/jpg
You can find an example of a command that tries to copy an image to the clipboard and is giving me thie error here: https://jsfiddle.net/g0Lff2b5/
When I try to use the example in the website, it works. I think that perhaps my base64 is invalid, even though I used many base64 generators, and setting this base64 into a tag works fine.
Anly ideas?
Well, I did a workaround fix that solves for now, but the main problem remain.
What I did in order to copy the image to the clipboard was to create a canvas object, add the image to it, and call the function that converts the image to a BASE64 string (.toDataURL('image/png')). then, I was able to copy this base64 to the clipboard.
Related
I am trying to convert an .htm file from the SEC website to a .pdf and have the internal links work. I am successfully converting to .pdf using wkhtmltopdf, but all the internal links point me back to the first page.
wkhtmltopdf https://www.sec.gov/Archives/edgar/data/1594617/000119312514117433/d640354ds1a.htm test.pdf
It looks like there's an issue with wkhtmltopdf dealing with anchor tags that have no content. There's a PR that was opened in 2017 to resolve it, but it remains open.
As it turns out, your document does indeed have empty anchor tags, so that's probably the root cause:
<A NAME="toc640354_15"></A>
I would suggest using chrome to produce the pdf, with its --headless and --print-to-pdf flags. From your chrome installation directory, do:
chrome.exe --headless --disable-gpu --print-to-pdf="C:\path\to\file.pdf" https://www.sec.gov/Archives/edgar/data/1594617/000119312514117433/d640354ds1a.htm
Make sure you specify an absolute path to the output file or it doesn't seem to work, for whatever reason. The command will immediately return without any output or indication of success. Give it a few seconds to retrieve, render and write the file.
I tested with your document, and the links work perfectly.
I'm attempting to parse an image that is possibly corrupt and it's driving me nuts trying to figure out what's wrong. Here is what I've deduced..
Example image: https://s3.amazonaws.com/edison_new/ffb3ccc402d6bd6-original
The images only show up in Chrome
Can't drag them to the desktop (on a mac).
Attempting to save them to computer yields a file that is "damaged or could not be open" when opening with Preview
Attempting to open in Photoshop yields "Could not complete your request because an unknown or invalid JPEG marker type is found."
Files are stored on Amazon S3
The meta data indicates the content-type to be image/jpeg
File definitely exists as you can see it in Chrome...
Anyone can help me deduce what is going on here??
The image is in WEBP format, its not natively supported in IE or FF so will not be displayed.
http://caniuse.com/#feat=webp
(I opened it in IrfanView to see what format it was)
I have a word 2007 document that is being used here as a template. In this template there are some bitmap image objects that are currently blank. The task is to write some text on these images.
The manual way is to edit the document and using paint I write the text on each of these images. But I am looking for a more dynamic way. Anything that can help me achieve my purpose.
I tried to do it using PHP but failed. PHPWord: Replaced image doesn't gets actually replaced
You can try DocxTemplater, which is a Javascript Library I maintain:
http://javascript-ninja.fr/docxgenjs/examples/demo.html#images
You can do that in the browser, but it works only in modern browsers (Chrome, FF, Safari latest versions). I recommend you to use nodejs.
Github Repository: https://github.com/edi9999/docxtemplater
In my Silverlight project, images for which the source URI does not contain the file extension don`t display, although the documentation says it should.
I set the image source like so:
imgCompanyLogo.Source = new BitmapImage(new Uri(Application.Current.Host.Source, "/Files/" + logoName));
Now, if "logoName" contains the file extension (like ".png" for example), the image is displayed fine, but it simply doesn't if the file is stored without an extension.
This seems to contradict the documentation here which states:
"The format-specific filename extensions such as .png are not necessarily required to be in the URI naming, but if the retrieved file is not determined to be a valid image format, a runtime exception is thrown."
I'm not getting any runtime exception either.
Is this a known issue or am I missing something simple?
Thanks!
PS: Just a little twist, the images display fine while debugging, not when the system is deployed...
I've made some test and the problem seems to be due to the response from the server.
If you try using .png within your project with a Build Action sets to Resource, both images will load regardless the extension.
Now if you try with images hosted on a server, it won't have the same behavior. Actually, if you try to browse the link to an image without extension directly in your browser, it will result in something else. On Chrome it will download the file, and on IE it will display the result as plain text.
That's because of the MIME type. A png should be returned with the type image\png.
There is a trick with .htaccess to set up the MIME-type but you need to have to specify for which extension. It works like this:
AddType image\png yourExtension [Extension2] [Extension3] ..
And if you want to see if why the image didn't load on your Image control, you can add an eventhandler to the ImageFailed event:
<Image Source="..." ImageFailed="Image_ImageFailed" />
But the error message that you will see is not really helpful:
ErrorException = {System.Exception: AG_E_NETWORK_ERROR}
I'm using CKEditor for my site.
Now I found the plugin called "MediaEmbed". I need it for embedding YouTube videos.
I installed it and the integration worked fine, but embedding won't work.
When you paste the code into the text area in the embedding dialog and then click on OK in IE and Chrome nothing happens and in Firefox it just adds a image as a flash-content-placeholder.
Let's say the flash-content-placeholder image would be just in the wysiwyg interface, but then i should get the embed code when I click on "view source" - but no, there you just see the source of the placeholder image div and img tag.
Then let's say the embed code is saved internally, so I save the file I create with CKEditor, and the out I get is just what I entered without the stuff the MediaEmbed plugin has generated at all.
How to fix this?
Please help!
Yours Joern.
use firebug and see, it'll be giving a cross domain error. the plugin has a bug. use try catch in the place where is accesses the windows.name property for a workaround.
Try istead ckeditor youtube plugin