Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


Pretty printing library


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-02-2007, 02:38 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default Pretty printing library

Finding myself unexpectedly released from jury duty for a couple of days I knocked up this desktop only library. I am rather pleased with it (he said modestly). It is compiled for .NET 2.0 but the source is provided and should compile without change under .NET 1.1.

It uses a RichTextBox to provide nicely laid out printed pages with choice of colour, font and alignment. Page setup, preview and print are provided and pagination is automatic. I am still looking to see if manual page breaks can be provided. The printing is based on some code I found in MSDN.

In normal use I envisaged that the RichTextBox would be made invisible and just used to build the document - the example enclosed keeps it visible. If you want to add events use my ControlEvents library and the ControlRef property of the RichTextBoxDesktop.

It is a work in progress and ultimately I will provide a help file. Please try it and post any suggestions for improvement.

EDIT :- Version 1.6 posted with CutSelectionToClipboard and CopySelectionToClipboard methods added. Help file updated.

EDIT :- Version 1.7 posted. Has WordWrap and Scrollbars properties added and a dummy library for the device. Help file updated. Sources for merging posted in separate zip file.
Attached Files
File Type: zip RichTextBoxDesktop1.7.zip (29.0 KB, 39 views)
File Type: zip RichTextBoxDesktopSource1.7.zip (6.0 KB, 29 views)

Last edited by agraham : 07-04-2008 at 01:07 PM.
Reply With Quote
  #2 (permalink)  
Old 11-02-2007, 08:51 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,321
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Nice,Very Nice
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #3 (permalink)  
Old 11-03-2007, 05:13 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

I don't think that I can take this library any further. This version 1.1 adds vertical offset for sub and superscripts, hanging indent at paragraph start, right and left (or both) indented text and bullets, tabs and new page.

The control background colour may be set, and the plain text and rtf formatted text obtained.

Text and bitmaps may be pasted from the clipboard.

Help file to follow once I get motivated to do it.

Pre 5.80 B4PPC will see some capitalised objects in the library - ignore them. 5.80 won't show them. Thanks Erel!

EDIT: Forgot the source. It is now included in the zip file.
Attached Files
File Type: zip RichTextDesktop1.1.zip (9.3 KB, 77 views)

Last edited by agraham : 11-03-2007 at 06:12 PM.
Reply With Quote
  #4 (permalink)  
Old 11-03-2007, 06:24 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,143
Default

Quote:
Thanks Erel!
Thank you for another great improvement
Reply With Quote
  #5 (permalink)  
Old 11-03-2007, 07:27 PM
giannimaione's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 155
Send a message via Skype™ to giannimaione
Awards Showcase
Beta Tester 
Total Awards: 1
Default Good work

Good work or
__________________
Gianni Maione
Reply With Quote
  #6 (permalink)  
Old 11-04-2007, 01:17 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Help file attached as promised.
Attached Files
File Type: zip RichTextBoxDesktopHelp.zip (12.0 KB, 63 views)
Reply With Quote
  #7 (permalink)  
Old 11-04-2007, 07:45 PM
Junior Member
 
Join Date: Jun 2007
Location: South Africa
Posts: 21
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Agraham,
This library came as a blessing to me, just what i needed great work

I have a question:
how can I get the program to print without the printer selection screen coming up, I am using a program as a print spooler and i dont want any user intervention. (The print server has no keyboard or screen)
It must print to default printer and it is mainly text

Thanks
Friedrich
Attached Files
File Type: sbp TranSpoolPrint1v0.sbp (4.8 KB, 39 views)
File Type: txt spool.txt (160 Bytes, 44 views)
Reply With Quote
  #8 (permalink)  
Old 11-04-2007, 07:59 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

If it's just text and you don't need the fancy stuff layout stuff you could try the Printer object in the DesktopOnly library.

You raise an interesting problem that I will investigate tomorrow (I have another day off jury duty ) to see if I can trigger printing somehow.
Reply With Quote
  #9 (permalink)  
Old 11-04-2007, 08:59 PM
giannimaione's Avatar
Senior Member
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 155
Send a message via Skype™ to giannimaione
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Agraham,
is it possible to control PrintPreview methods?
example: maximaze form ; select value of Zoom ;

sorry for my bad english
__________________
Gianni Maione
Reply With Quote
  #10 (permalink)  
Old 11-05-2007, 10:25 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,700
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Softselect View Post
how can I get the program to print without the printer selection screen coming up,
I will post a version that will let you do this do this later today.

Quote:
Originally Posted by giannimaione View Post
is it possible to control PrintPreview methods?
example: maximaze form ; select value of Zoom
I can give you Top and Left (position on screen), Height and Width (size) and WindowState (normal, minimised & maximised) later today. I can't easily do anymore as this dialog is designed for user interaction not program control.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PhoneticAlgorithms Library (ex-StringComparison Library) moster67 Additional Libraries 10 11-11-2008 08:46 PM
printing capabilities Cableguy Basic4ppc Wishlist 13 07-21-2008 04:02 PM
Door library (Beta) - Special library Erel Official Updates 48 07-18-2008 03:33 PM
Merging Outlook library and Phone library Erel Official Updates 2 07-14-2008 04:38 PM
printing and barcode printing help jchal Questions & Help Needed 3 06-02-2008 07:05 PM


All times are GMT. The time now is 11:19 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0