Help!

Print SVG Document in VB.Net using visio.Document object

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Printing RSS
Next:  Visio 2003 SP2 installation  
Author Message
Murali Mohan P
External


Since: Sep 13, 2005
Posts: 2



PostPosted: Tue Sep 13, 2005 1:42 am    Post subject: Print SVG Document in VB.Net using visio.Document object
Archived from groups: microsoft>public>visio>printing (more info?)

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
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Printing All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum