Wednesday, July 11, 2012

I just want to learn VB.Net. No Biggie.

 Well.  I have programmed in VB from version 3 to version 6, not commercially except for a practice management program I use daily, and a staff rostering program was (is??) used around Australia by a big optical company.  I mainly do front ends to databases (Access, yes, I know, I know; could never get around to or afford, say, SQL Server).  A man needs a hobby, amirite?  A few years ago I reckon I could have done it for a living, now I have been well and truly left behind!

So, I need to get into a new development environment.  I am tempted to go with C#, but I find it difficult to cut myself off from Visual Basic.  I have a simple project that I want written, so I plan to use VB.Net with Visual Studio 2012 to create it.  So, jumping 4 versions of VB in one hit.  OMG!


I want to create the following program:
A Metro-style program in which I can choose already created documents, and send them to a printer.  In addition, I want to select some options (text and images), generate a document, and send a newly generated document to a printer.
Sounds easy.


I initially thought I would just send a PDF to Acrobat with a command to print.  Pfft.  Turns out that is really tricky if you don't want Acrobat to have a UI, and if you don't want to use the default printer.  PDF libraries are really quite expensive, so I shelved that idea after a couple of days of research.


Then I thought, "Wait a minute!  Hasn't Microsoft developed a PDF killer!  I'll do it in XPS format!!!".  LOLZ.


In the last day, I have come to realise that the internetz is a black hole for information about creating XPS documents in VB.NET/WPF.  I can now do my first part, which is load an XPS document and send it to the printer of my choosing, but the second part is really hard to find VB.Net info on.  There is a bit of C# stuff around, but I'm already struggling to learn VB.Net; to convert from C# to VB.Net is one step too far for this VB6 casual programmer!  I really get the feeling that Microsoft has given up on XPS...


So I thought I would record my progress so that others may find a few short cuts.  Of course, there is every possibility that I will fail/give up/not post, but my intentions are good.


If you come across this Blog, and have better solutions, PLEASE add them in comments.  Thanks!


Rene

No comments:

Post a Comment