Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P 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, 01:38 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
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.

EDIT:- Version 1.8 allows user formatting and editing of text. See post #67.
Attached Files
File Type: zip RichTextBoxDesktop1.8.zip (35.2 KB, 238 views)

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

Nice,Very Nice
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #3 (permalink)  
Old 11-03-2007, 04:13 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
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, 137 views)

Last edited by agraham : 11-03-2007 at 05:12 PM.
Reply With Quote
  #4 (permalink)  
Old 11-03-2007, 05:24 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

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

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

Help file attached as promised.
Attached Files
File Type: zip RichTextBoxDesktopHelp.zip (12.0 KB, 117 views)
Reply With Quote
  #7 (permalink)  
Old 11-04-2007, 06:45 PM
Junior Member
 
Join Date: Jun 2007
Location: South Africa
Posts: 42
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, 89 views)
File Type: txt spool.txt (160 Bytes, 86 views)
Reply With Quote
  #8 (permalink)  
Old 11-04-2007, 06:59 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
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, 07:59 PM
giannimaione's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Naples, Italy
Posts: 244
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
Reply With Quote
  #10 (permalink)  
Old 11-05-2007, 09:25 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Door library (Beta) - Special library Erel Official Updates 60 01-13-2011 11:23 AM
Merging Outlook library and Phone library Erel Official Updates 11 09-15-2010 09:22 AM
printing capabilities Cableguy Basic4ppc Wishlist 15 03-18-2009 03:13 AM
printing and barcode printing help jchal Questions (Windows Mobile) 5 12-13-2008 05:52 AM
PhoneticAlgorithms Library (ex-StringComparison Library) moster67 Additional Libraries 10 11-11-2008 07:46 PM


All times are GMT. The time now is 10:08 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0