Home All Groups Group Topic Archive Search About

Can anyone recommend a print contol library please?

Author
24 Mar 2010 7:02 PM
Alan
Hello,

Can anyone recommend print control libraries for VB .Net please? I'm
writing an app to print the attachments of mail messages and it's
difficult to handle PDF, Office and any possible graphic file format
via the standard printprocess. Ideally, I'd just like to save the
attachments to disk and and then pass the filenames to a control,
which would popup the standard print dialog or just print.

Thanks,

- Alan.

Author
24 Mar 2010 7:12 PM
Rich P
If I am reading your question correctly, you are trying to print the
contents of an email attachment from your .net app -- bypassing having
to open the attachment.  If you are reading the contents from your code
you can then place these contents into a .Net report control (rdlc file)
and then use emf to print that out.

Here's a link where you can print using EMF with a .rdlc file:

http://msdn.microsoft.com/en-us/library/microsoft.reporting.winforms.cre
atestreamcallback(VS.80).aspx

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Author
24 Mar 2010 8:43 PM
Alan
Thanks Rich.

Yes, I'm saving the attachments to a temp directory, then printing
them out. Problem is that the different potential types need to be
handled differently, e.g, PDF vs Word.

First time I've heard of EMF so I'll check it out...

On Mar 24, 8:12 pm, Rich P <rpng***@aol.com> wrote:
Show quoteHide quote
> If I am reading your question correctly, you are trying to print the
> contents of an email attachment from your .net app -- bypassing having
> to open the attachment.  If you are reading the contents from your code
> you can then place these contents into a .Net report control (rdlc file)
> and then use emf to print that out.
>
> Here's a link where you can print using EMF with a .rdlc file:
>
> http://msdn.microsoft.com/en-us/library/microsoft.reporting.winforms.cre
> atestreamcallback(VS.80).aspx
>
> Rich
>
> *** Sent via Developersdexhttp://www.developersdex.com***
Author
25 Mar 2010 7:57 AM
Cor Ligthert[MVP]
Alan,

You can use Crystal Reports or a 3th party tool.

For your problem I would probably take the Visual Basic powerpack and follow
the Print part of that.
(If it is not PDF otherwise I would probably simple create an application
start with the PDF in it, and then it)

Cor

Show quoteHide quote
"Alan" <bru***@gmail.com> wrote in message
news:f8b25ed4-681e-43da-8081-631cee2f8f78@g11g2000yqe.googlegroups.com...
> Thanks Rich.
>
> Yes, I'm saving the attachments to a temp directory, then printing
> them out. Problem is that the different potential types need to be
> handled differently, e.g, PDF vs Word.
>
> First time I've heard of EMF so I'll check it out...
>
> On Mar 24, 8:12 pm, Rich P <rpng***@aol.com> wrote:
>> If I am reading your question correctly, you are trying to print the
>> contents of an email attachment from your .net app -- bypassing having
>> to open the attachment.  If you are reading the contents from your code
>> you can then place these contents into a .Net report control (rdlc file)
>> and then use emf to print that out.
>>
>> Here's a link where you can print using EMF with a .rdlc file:
>>
>> http://msdn.microsoft.com/en-us/library/microsoft.reporting.winforms.cre
>> atestreamcallback(VS.80).aspx
>>
>> Rich
>>
>> *** Sent via Developersdexhttp://www.developersdex.com***
>
Author
25 Mar 2010 7:22 PM
Alan
Thanks Cor.

Just to be clear, I don't want to display the files or make any
reports. All I want to do is basically pass the filename and get it
printed out, regardless of whether it's a TIF, DOC or XLS file.

PrintForms will handkle that?

If not, can you name any 3rd party components pls? Thanks.


Show quoteHide quote
On Mar 25, 8:57 am, "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl>
wrote:
> Alan,
>
> You can use Crystal Reports or a 3th party tool.
>
> For your problem I would probably take the Visual Basic powerpack and follow
> the Print part of that.
> (If it is not PDF otherwise I would probably simple create an application
> start with the PDF in it, and then it)
>
> Cor
>
> "Alan" <bru***@gmail.com> wrote in message
>
> news:f8b25ed4-681e-43da-8081-631cee2f8f78@g11g2000yqe.googlegroups.com...
>
> > Thanks Rich.
>
> > Yes, I'm saving the attachments to a temp directory, then printing
> > them out. Problem is that the different potential types need to be
> > handled differently, e.g, PDF vs Word.
>
> > First time I've heard of EMF so I'll check it out...
>
> > On Mar 24, 8:12 pm, Rich P <rpng***@aol.com> wrote:
> >> If I am reading your question correctly, you are trying to print the
> >> contents of an email attachment from your .net app -- bypassing having
> >> to open the attachment.  If you are reading the contents from your code
> >> you can then place these contents into a .Net report control (rdlc file)
> >> and then use emf to print that out.
>
> >> Here's a link where you can print using EMF with a .rdlc file:
>
> >>http://msdn.microsoft.com/en-us/library/microsoft.reporting.winforms.cre
> >> atestreamcallback(VS.80).aspx
>
> >> Rich
>
> >> *** Sent via Developersdexhttp://www.developersdex.com***
Author
25 Mar 2010 11:32 PM
Rich P
Quick Note on the EMF printing idea:  you set up an rdlc file (drag a
report control onto a form and it will automatically create an rdlc
file).  In the rdlc you add the controls that you want to print content
from - like an image control for a picture, or a textbox for text, etc.
With the emf technique -- you don't display the report control or
contents ...  it just prints out the contents to the printer.  Go to the
link above and check it out.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Author
26 Mar 2010 10:24 AM
Alan
Thanks Rich.

I checked the link but how does it know if it's a text file or a Word
doc or an image or PDF? Do I have to explicitly use a SELECT .. CASE
with every possible file extension?

Sorry for the trouble. This is really something difficult to me.

On Mar 26, 12:32 am, Rich P <rpng***@aol.com> wrote:
Show quoteHide quote
> Quick Note on the EMF printing idea:  you set up an rdlc file (drag a
> report control onto a form and it will automatically create an rdlc
> file).  In the rdlc you add the controls that you want to print content
> from - like an image control for a picture, or a textbox for text, etc.
> With the emf technique -- you don't display the report control or
> contents ...  it just prints out the contents to the printer.  Go to the
> link above and check it out.
>
> Rich
>
> *** Sent via Developersdexhttp://www.developersdex.com***
Author
26 Mar 2010 10:53 PM
Rich P
Hi Alan,

Well, you will have to write a little bit of code here.  When reading
your document, you would read text to some string var and then set the
text property of a textbox to the string var.  If it is a pdf (I haven't
tried this yet) but I believe you can embed the pdf file into the rdlc
into a control and print that control.  Basically, you would have to
detach the pdf and then pass the location to the rdlc and then print the
rdlc.  I am not sure what control would take a pdf.  It should be in the
link I posted above.  The specific section of the link is just for
printing but the rest of the sections pertain the the report control.

So you would detach the pdf, pass the location to the rdlc, print the
pdf, and then delete the pdf from the location.  That should be seamless
to the user.

If the PDF is just pure text, you could read the contents and then pass
that to the rdlc and print that -- just to give you some ideas.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Author
20 Apr 2010 12:00 PM
Alan
Finally tried using PrintForms in VSS2008. It was going well until I
discovered that a single form was too small for A4 paper.

Why oh why is printing so complicated in VB .Net?

On Mar 27, 12:53 am, Rich P <rpng***@aol.com> wrote:
Show quoteHide quote
> Hi Alan,
>
> Well, you will have to write a little bit of code here.  When reading
> your document, you would read text to some string var and then set the
> text property of a textbox to the string var.  If it is a pdf (I haven't
> tried this yet) but I believe you can embed the pdf file into the rdlc
> into a control and print that control.  Basically, you would have to
> detach the pdf and then pass the location to the rdlc and then print the
> rdlc.  I am not sure what control would take a pdf.  It should be in the
> link I posted above.  The specific section of the link is just for
> printing but the rest of the sections pertain the the report control.
>
> So you would detach the pdf, pass the location to the rdlc, print the
> pdf, and then delete the pdf from the location.  That should be seamless
> to the user.
>
> If the PDF is just pure text, you could read the contents and then pass
> that to the rdlc and print that -- just to give you some ideas.
>
> Rich
>
> *** Sent via Developersdexhttp://www.developersdex.com***
Author
20 Apr 2010 2:31 PM
Patrice
Hi,

A know method is to use the "Print" "verb" :

"If the file name involves a nonexecutable file, such as a .doc file, you
can include a verb specifying what action to take on the file. For example,
you could set the Verb to "Print" for a file ending in the .doc extension.
The file name specified in the FileName property does not need to have an
extension if you manually enter a value for the Verb property. However, if
you use the Verbs property to determine what verbs are available, you must
include the extension."

(from
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.startinfo.aspx).

--
Patrice
Author
21 Apr 2010 6:10 AM
Alan
Thanks Patrice. That's ok for any attachments, but not for the message
itself.

I'll just have to jump in to PrintDocuments and Graphic.Drawstring
etc.


Show quoteHide quote
On Apr 20, 4:31 pm, "Patrice" <http://scribe-en.blogspot.com/> wrote:
> Hi,
>
> A know method is to use the "Print" "verb" :
>
> "If the file name involves a nonexecutable file, such as a .doc file, you
> can include a verb specifying what action to take on the file. For example,
> you could set the Verb to "Print" for a file ending in the .doc extension..
> The file name specified in the FileName property does not need to have an
> extension if you manually enter a value for the Verb property. However, if
> you use the Verbs property to determine what verbs are available, you must
> include the extension."
>
> (fromhttp://msdn.microsoft.com/en-us/library/system.diagnostics.process.st...).
>
> --
> Patrice