I want to use Prawn or PDFkit library for generating PDF into my Rhomobile application.
Please suggest the process.
I was using pdf_writer which is supported by Rhomobile but there are issues including images in the generated pdfs.
Plz help
Adding image with using pdf_writer is possible but using tricky way. first you need to store that image in DB as a blob data, then through query you need to fetch blob data from that table and need to print that blob data on PDF.
Note : this is only applicable for for raw RGB formatted images.
Related
My goal is to send a dataframe table to the user via Microsoft Bot framework for python.
I tried different methods to send a dataframe using the MessageFactory text and attachment methods. I even tried converting the dataframe object into an image and then send the base64 mime. This worked, however the image was very magnified, and cannot be clicked to view, making most parts of the table unreadable.
I read there are ways to define your own schema (xml/markdown) for tables, but could not find any appropriate resources on how to use them. Do let me know of any way possible.
You can use adaptive card table format to show the data
I wrote some basic blog system, which based on spring boot.
I'm trying to figure out, how can I create posts with videos and images, without the need to editing everything using HTML.
Right now, I am saving my blog posts in DB as plain text.
Is it possible to create content combined with text, images and videos , and saving this "content" as one row in my DB-Table, without creating connections between different tables?
Many thanks in advance.
Images and Videos are heavy content and storing them in database could be a costly affair, until you are developing application for research purpose. Also querying it from database and serving it over the network can impact your application performance.
If you want to store it in a single row that can be done as well using database BLOB object. But i would suggest to have 2 different tables. One containing the BLOB object of Image and Videos and other is your usual table containing blog as text and primary key of of BLOB table.
If you want to take your solution to go live, better use image-videos hosting servers because of following factors
Saves your database cost
Ensures 24x7 availability
Application performance is faster as these are hosted independent of application
Videos can directly be iframed i.e. you do not need to query complete MBs of record and serve over network
A strict answer to your question, yes, you can use BLOBs to store the video/images in the database. Think about them as a column that contains bytes of video or image.
For school/cases where you have a very small amount of videos/images its probably OK. However if you're building a real application, then don't do it :)
Every DBA will raise a bunch of concerns "why do not use Blobs".
So more realistic approach would be to find some "file-system" like storage (but distributed) style S3 in AWS, hardrive on server if you're not on cloud, etc.
Then store that big image / video there and get an identifier (like path to it if we're talking about the harddrive) and store that identifier in the database along with the metadata that you're already store probably (like blogPostId, type of file, etc.)
Once the application become more "mature" - you can switch the "provider" - Grow as you go. There are even cloud storages designed especially for images (like Cloudinary).
I am working on hybrid mobile application in which I have a scenario to store images in to oracle database through web-API. I can get the images as base-64 encoded from API. So how can i save them to database and what datatype should I use to store them
If you want to insert image you can use BLOB data type . about how storing pictures in database check storing pic and photos and how to store image
I want to storage images and the core data database of my app but I can not figure out how to add the images to my core data data base. By any chance any of you knows how can I do this?. I'll really appreciate your help.
This can by done by using a Binary Data attribute on your entity. This allows you to store binary data (such as images or files) directly in a core data database. If the files/images are expected to be over 10MB, I would check the "Allows External Storage" checkbox in the attribute inspector for your binary data attribute. This allows core data to store this data in a file external to your .sqlite file. This helps with fetching/saving efficiency, but if you have a heavy load of images/files, you're better off managing the files yourself. Core Data isn't optimized for large blobs of data.
You have to add images as binary data, NSData.
But this is not efficient to handle. Better way to save the images as file and then store the file name in the database. This will save the query overhead.
You might want to consider using a Transformable attribute which will handle the transformation to and from NSImage automatically. Bear in mind if you want images to be compatible with iOS you best stick with PNG format.
I capture images within my app and need to store them. I'm not sure where the right place is to store the captured image. Storing the image as byte array in the database would be very nice but whats happening if the next-gen smartphones getting a high-resoltion camera and the images become bigger? Are they exceeding my database limit or my app becomes slowly?
Is it better to store the image into IsoStore?
I'd store in the isostore, if you want to use database, you might just store the path of the image or name to be able to find it from the isostore.
It should be faster to use isostore instead of database.
If you want to store image in database use blob type attribute in database,
Convert the image in byte-array and execute the database command.
To convert the object in byte array follow the link.
This answer is based on sqlite database.