Image manipulate in lexical editor - editor

I am working on blog like web project using lexical editor in nextjs.
I am trying to implement image plugin in lexical editor. For now it coverts to base64 format which will be expensive for storing in database. Instead of storing base64 I want to store the image link along with other text inside database. Also I am facing issue to implement image plugin of lexical editor in nextjs.
steps I want to follow
I want to upload image in aws s3 and then want to show in editor as image.
Another way I am trying to implement like a modal will open where image can be selected
and it uploads to aws s3 and gets image url, then want to show image url in editor.
Is there any solution for it?
Thanks in advance for any suggestion

Related

How to highlight text in pdf using PdfKit

I am creating app where i need to load the pdf file from document directory and need to highlight text manually by user.
Also we need to export the updated pdf file and upload it to the server.
Is there any way to manage the same using pdfkit ?
Please share the sample code if available.
We are using the library as a reference is listed below
https://github.com/uxmstudio/UXMPDFKit
This library is using the same concept as we need but exporting the pdf is the main task we need to achieve.
In simple word we can say that user can highlight some text from the displayed pdf text and upload it to the server.

How do I allow images in a textbox | ASP.NET Core

I am developing an ASP.NET Core application & I need a control as described below:
Is there an existing control or a way to allow users to insert images in a textbox.
There is no way to simply insert an image into a textbox. WYSIWYG editors like TinyMCE give the appearance that this happening by rendering a HTML area with an img tag pointing to an image file at some location. In the end, what's submitted is this backing HTML, not the image itself.
For something like an image that already exists at some publicly-accessible location online, nothing more is required. However, if you're talking about allowing a user to embed an image that exists only on their local filesystem, that requires additional machinery. Again, WYSIWYG editors like TinyMCE often include something along the lines of a "file browser" or "upload" control that handles this type of thing. When the user picks an image from their computer, the control uploads that image to some location on the server and then, again, adds a simple img tag pointing to the now online location of that image. This has to be configured, though. There's usually server-side scripts that must be installed on the server and you have to somehow tell it both where to store the uploaded images and how to address them from a publicly-accessible URL. This is likely what you're missing with TinyMCE. However, setting all that up is beyond the scope of Stack Overflow. Consult the documentation for your library of choice.

How should I upload text with images Swift

I am tryin got upload a document/textView with images to my server...
Now I am trying to figure out what would be the best way:
1) You can add the images 1 by 1 to UITextView and lower the quality and upload the whole textView NSAtributedString as a NSData file or a .txt file, and then decode it when downloading.
2) While adding the images to the UITextView I upload them to the server and store a URL link to the images in the UITextView in the same place of the image, and before upload the text with the url's I convert that all to HTML and then display that in a UIWebView.
Now first option seems to be the easiest to setup, but not neccessarily the quickiest, as the final file you upload could be 2-10 mb with roughly 5-7 images with a basic quality....
Now the second option is done in app's like WordPress, and looking at they're code on github Github WordPress Keyboard they convert it differently to html using "libxml2" and store the url for the image when adding it....
And this option seems to be alot quicker I would of thought...
Now I think the second option would be the best, but I am pretty sure it can be done without using the amount of code wordpress use.
Is there a way of changing the url of an image when adding it as NSTextAttachment? Because when you convert NSAttributedText to html, the image just gets the local link to the file, and the name of the file is just "attachment"..
Now If anyone could give me some advice or better options that would be great!
Many thanks to anyone that spares some time to read this!
Create an image upload service which accept image and url as argument. Then you can generate those image url before sending them to image server and replace those local url with the generated image url.
Edit:
Maybe you can store the location of those images and remove them from the NSattributedstring first and replace with <img src = "url"> before converting it to "HTML".
But I would suggest you using one of those HTML Parser such as KANNA.

XML SDK 2.0 - Images - Excel file

With the use of the Open XML SDK 2.0, I did preformed the Reflected Code of an Excel file.
Along with other things, the Excel file has some images in some of the cells. When I run the code that was generated, the file show the images just fine.
What I need to do is to programatically inject images in place of the
images that are there now. The thing is, I cannot find where the images are at in the code that was generated. How can I figure this out? Also what is the easiest way to replace those images with new ones programmatically?
You may want to take a look at a similar question about inserting images into Excel files with OpenXML SDK: C# & OpenXML: Insert an image into an excel document.
Basically, those files are created as separate document parts. The answer I linked to should show You how to insert a new image into a document, however, in order to substitute existing images with your custom ones, you could probably just modify the binary data of appropriate ImagePart (and some other associated properties).
If You need some help with the code performing this task, let me know.

HighCharts image export

I am using HighChart in my application.
I want to export chart image on a button click like http://jsfiddle.net/hfrntt/fXHB5/1896/.
but i want to save image in a predefined folder and remove the save dialog pop-up to save image.
On button click image saved on the predefined folder.(No save dialog)
Thanks in advance
You have to setup an exportserver. Upon the client sends the Highcharts SVG file to this service it will be converted to an image. Before the server returns the image to the client you can save it to the predefined filesystem.
Here you can find a php export server and a java based one. https://github.com/highslide-software/highcharts.com/tree/master/exporting-server developed by Highcharts
These exportservers are setup to remove the temporary created files. You have to change the code a bit to prevent this.
read also this article for more background information on Highcharts exportservers
This is going to involve much more than simply using highcharts. You are going to have to use some sort of wrapper that will actually render the chart/page on the server-side and then essentially output it as an image. The following are links taken from a post on the highcharts website.
GWT Highcharts wrapper
Highcharts-server-side-export (with Rhino/Batik)

Resources