Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [TestMethod]
- public void IdmlToSvg()
- {
- //const string idmlFile = @"D:\SGE\w2p\card\file.idml";
- const string idmlFile = @"D:\SGE\w2p\card\C108-F128-710-finance-insurance-business-cards-2-P.idml";
- using (var reader = new IdmlReader(idmlFile, 300, 300))
- {
- for (int i = 0; i < reader.Spreads.Count; i++)
- {
- var spread = reader.Spreads[i];
- var frame = reader.Frames[i];
- using (var svgWriter = new SvgWriter($"D:\\SGE\\w2p\\card\\output\\{i}.svg", frame.Width, frame.Height, 300, 300))
- {
- var svgGraphics = svgWriter.GetGraphics();
- for (var ix = 0; ix < spread.Items.Count; ix++)
- {
- SpreadItem item = spread.Items[ix];
- GraphicsContainer graphicContainer = item.GetItemContent();
- svgGraphics.DrawContainer(graphicContainer, 0, 0);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement