g21589 / wmf2canvas Goto Github PK
View Code? Open in Web Editor NEWConvert WMF/EMF (Windows Metafile) image file to HTML5 canvas by using pure javascript.
Home Page: http://g21589.github.io/wmf2canvas/
Convert WMF/EMF (Windows Metafile) image file to HTML5 canvas by using pure javascript.
Home Page: http://g21589.github.io/wmf2canvas/
This affects rotated text (for example, a vertical axis title in a chart)
The META_CREATEFONTINDIRECT
record stores the angle in the Escapement field (https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-wmf/dabb1ed6-e5e8-4243-80ed-e63443e5484f). To be more precise, it stores the angle in tenths of a degree.
To support text angle, the following mantra works:
ctx.save();
ctx.translate(x_offset, y_offset);
ctx.rotate(-(escapement / 10) * Math.PI / 180);
ctx.fillText(text, 0, 0);
ctx.translate(-x_offset, -y_offset);
ctx.restore();
Thank you for making your library available.
The project mentions both WMF and EMF, but as far as I can see, there is no actual support for EMF. Am I missing something, or is EMF support just in the planning stages?
Chrome 版本 70.0.3538.67(64 bit),http://g21589.github.io/wmf2canvas sample :
let wmf = new WMFConverter(); // Uncaught ReferenceError: WMFConverter is not defined
emf.zip
this is a sample file.
I need to change the height and width of the the resultant canvas image while drawing it in canvas
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.