ImageProvide Class in FOP Apache - apache-fop

while generating pdf which contain image logo.gif with FOP getting error
Error while loading image (Jimi): com/sun/jimi/core/Jimi
when i generate pdf with FOP source i come to know that ImageProvider class,
if ImageProvider class is JAIImage not getting any error but when JIMIImage class available then getting error because it is calling function Jimi.getImageProducer which is in jimi.jar file path com.sun.jimi.core.Jimi.
can any one please tell on what bases the ImageProvider Class is get selected in FOP while generating pdf which contain image.

Related

How to load pdf file from directory using PdfDocument.load using pdf package in flutter desktop

I am able to read the file as byte
final bytes = File("path....").readAsBytesSync();
//now, here is the problem
final doc = PdfDocument.load(parserBase);
★ that abstract class PdfDocumentParserBase(bytes) takes Uint8list as its argument which is also a parameter for
PdfDocument.load(parserBase)
, am not good at abstract classes and don't know how to use it in the method.
What I want to achieve is merging multiple pdf files.
Please help me out.
Thanks

How to convert svg path to list of points in flutter

I wrote code to find in SVG string specific path with proper id.
How can I transform the SVG path into a list of points?
Or svg_path_parser's Path can be magically decrypted into list of Offsets? Because Path.contains(offset) method refers to native implementation.

Flutter: How to get a File object from ImageProvider in Flutter?

How can I get a File from an ImageProvider?
ImageProvider imageProvider = NetworkImage(networkUrl);
File file = imageProvider ?
Although ImageProvider with NetworkImage renders the content of your network image URL, it doesn't have direct APIs or easy way for you to be able to convert it to a File object. With that said, you can still manually cache (or download) the image/s and get the download stream.
As far as I can understand your question, you are trying to access the network image URL as a File object. Instead of using ImageProvider, you can take a look at the flutter_cache_manager, which is a plugin used for downloading and caching files locally, and save it for later use.
Example Usage
Downloading network image file from URL
await DefaultCacheManager().downloadFile(url);
Retrieving File object from the cache dir
// Retrieving File object
var file = await DefaultCacheManager().getSingleFile(imageUrl);
// File object available for use
// Eg. Reading file as string
file.readAsStringSync(...);
Further reading
https://pub.dev/packages/flutter_cache_manager
https://pub.dev/packages/cached_network_image

MATLAB: websave function doesn't save the image

I am using the following function to save map from mapquest as a png file as follows
f_name='abc.png';
url='https://www.mapquest.com?center=1.34,103.683'
%other parameters also go through the url.
websave(f_name, url);
Image is saved but it cannot be displayed throwing the following error.
Error using imread>get_format_info (line 543)
Unable to determine the file format.
Error in imread (line 391)
fmt_s = get_format_info(fullname);
Subsequently following line also throws an error.
[M, Mcolor] = imread(filepath);
When image is opened a message is displayed
File format is not supported.
But if its extension is changed for example to html it does try to load the actual web page display.
Any clues will be highly appreciated
Finally I managed to find the way to do this after a little research!
Static APIs are used in this regard and are available with maps like Google, Mapquest etc.
These static APIs convert the web page of map to its respective image, to put an example for Mapquest it can be used using this

Regarding external-document in FOP

I am creating pdf file through the XML, XSL and FOP. I want PDF file contents to display external file contents such as word document.
I know for displaying image in PDF we use but what tag we should to display file contents other than pdf file type.
There's a FOP extension that claims to be able to do this:
jeremias-maerki.ch/development/fop/index.html
Also see xmlgraphics.apache.org/fop/1.0/extensions.html#external-document
When I used in this way
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions"
content-type="pdf" src="C:\temp\reports\p2.pdf"/>
I am getting exception as
org.apache.fop.apps.FOPException: Error(Unknown location): No element mapping definition found for fox:external-document
Let me know the reason.
THanks in advance.
I'd say you're probably using an old Apache FOP version which doesn't have the fox:external-document extension, yet. Please upgrade to FOP 1.0 (or at least 0.95).
Change the namespace from:
http://xml.apache.org/fop/extensions
to
http://xmlgraphics.apache.org/fop/extensions