I want to print the SVG Document in VB.Net by using the Visio. Document Component.
Please check the Process :
Step 1 : Create SVG File in C drive. (C:\Block.svg).
Note : Please copy the following xml tags in new text document and save as SVG file. “Block.svg”
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!-- Generated by Microsoft Visio 11.0, SVG Export, v1.0 B5.svg Page-1 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="8.5in"
height="11in" viewBox="0 0 612 792" xml:space="preserve" color-interpolation-filters="sRGB" class="st1">
<v:documentProperties v:langID="1033" v:viewMarkup="false"/>
<style type="text/css">
<![CDATA[
.st1 {fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3}
.st2 {fill:#e8eef7;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}
]]>
</style>
<defs id="Masters">
<symbol id="master0" v:mID="0" class="st1">
<title>Square</title>
<g id="master-shape5-2" v:mID="5" v:groupContext="shape">
<title>Sheet.5</title>
<v:userDefs>
<v:ud v:nameU="visVersion" v:val="VT0(11):26"/>
</v:userDefs>
<rect x="0" y="684" width="108" height="108" class="st2"/>
</g>
</symbol>
</defs>
<g v:mID="0" v:index="1" v:groupContext="foregroundPage">
<v:userDefs>
<v:ud v:nameU="SchemeName" v:val="VT4(Default)"/>
</v:userDefs>
<title>Page-1</title>
<v:pageProperties v:drawingScale="1" v:pageScale="1" v:drawingUnits="0" v:shadowOffsetX="9" v:shadowOffsetY="-9"/>
<v:layer v:name="Connector" v:index="0"/>
<use id="shape1-1" v:mID="1" xlink:href="#master0" transform="translate(72,-648)">
<title>Square</title>
</use>
</g>
</svg>
Step 2: Create new VB.Net Project and copy following code in form.
Dim objApp As New Visio.InvisibleApp
Dim objDoc As Visio.Document
objDoc = objApp.Documents.Open(“C:\Block.svg”)
‘If I can print by using “HP LaserJet 5000 Series PCL”. I am unable to print by using Microsoft Office Document Image Writer or PDF Type one.
objDoc.Printer = “Microsoft Office Document Image Writer” ‘ or PDF
objDoc.PrintFitOnPages = True
objDoc.PrintOut(Visio.VisPrintOutRange.visPrintCurrentPage, , , , , True, “Block”)
objApp.ActiveDocument.Saved = True
objApp.ActiveDocument.Close()
objApp.Quit()
objApp = Nothing
objDoc = Nothing
If I do like this I could able to save/print the file, but it is saving in System32 Folder (E.g.: C:\WINDOWS\system32\Block.mdi). I want to save this file in specified folder; I want to know how to specify the folder.
Please assist me, How to solve this problem.
If we couldn’t do by using the above process, please let me know the process.
with Regards,
Murali