<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Setting Printer</title><link>https://www.infopathdev.com:443/forums/thread/74915.aspx</link><pubDate>Fri, 03 Feb 2012 03:19:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:74915</guid><dc:creator>Chris Martin (MQS)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/74915.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=74915</wfw:commentRss><description>I am trying to set the &amp;#39;Default&amp;#39; printer in InfoPath using VB.NET.  

I am NOT trying to set the Windows default printer, and I cannot instantiate a new PrintDocument() class.  I want to mimic the change that happens when I click &amp;quot;Flie -&amp;gt; Print&amp;quot;, Select another printer, then click close.

Essentially, I have a form that needs to be printed as a PDF, but the only available Writer is CutePDF.  I CANNOT set CutePDF as the default Windows printer, so it needs to be selected at runtime.  I have tried to instantiate a new PrintDocument() class, but CutePDF does not encode correctly when printing from code (you have to purchase the SDK).  

My current problem is that the Windows default printer is a label maker with a paper size of 2.5&amp;quot; x 3.5&amp;quot;.  This printer CANNOT be changed due to requirements of other software.  When I use &amp;quot;CurrentView.Export&amp;quot; I get a PDF but everything is blown up due to it printing an 8.5&amp;quot; x 11&amp;quot; document on such a small paper.

I need to somehow modify the currently selected printer in InfoPath, that way the &amp;quot;CurrentView.Export&amp;quot; function will use a printer with the correct page size.

Hope that takes care of the details!

Chris</description></item></channel></rss>