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
  #11 (permalink)  
Old 11-05-2007, 10:29 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
The print server has no keyboard or screen
Please make sure that you trap and handle (or ignore) any errors as there is no error handling in the library - any errors are thrown back to B4PPC.
Reply With Quote
  #12 (permalink)  
Old 11-05-2007, 02:11 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

Here it is. Version 1.2 with updated help and sample file - throw all previous versions away!

Top, Left, Height, Width and WindowState properties for Print Preview.

RichTextBoxDesktop.Print now prints immediately. New method RichTextBoxDesktop.PrintDiallog displays the print dialog.

New property RichTextBoxDesktop.PageSetupMetric to help deal with the Page Setup dialog metric "feature". See the Overview in the help file.

This needs .NET 2.0
Attached Files
File Type: zip RichTextBoxDesktop1.2.zip (21.9 KB, 43 views)
Reply With Quote
  #13 (permalink)  
Old 11-05-2007, 08:02 PM
Junior Member
 
Join Date: Jun 2007
Location: South Africa
Posts: 21
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Agraham,
Well done, you make it all look so simple
So far its working perfect for me, it is as if you read my mind with this lib, i was panicing how i was going to do nice printing, customers and friends always say plain text is good enough until it is what you give the, then its a problem.
Thanks for your effort and responce to my request
Friedrich
Reply With Quote
  #14 (permalink)  
Old 11-05-2007, 09:50 PM
Junior Member
 
Join Date: Jun 2007
Location: South Africa
Posts: 21
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Agraham,
I have a problem repeating my program (attched), when i print with your lib, delete the file and want to scan the drive for the next file (spool function)
nothing happens, could you please help, i seem to be stuck here. Brain freeze
This needs to happen without user intervension as the print server doesnt have a screen or keyboard
Thank you
Friedrich
Attached Files
File Type: sbp TranSpoolPrint1v1.sbp (7.7 KB, 20 views)
File Type: txt spool.txt (154 Bytes, 22 views)
Reply With Quote
  #15 (permalink)  
Old 11-06-2007, 09:03 AM
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

Well done,
good, good, very good...

__________________
Gianni Maione
Reply With Quote
  #16 (permalink)  
Old 11-06-2007, 10:03 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
could you please help, i seem to be stuck here.
Several things wrong I am afraid

The first problem is that you have a "Return" statement in App_Start. This is terminating the progam by exiting from App_Start.

Secondly (after removing the return) at the end of App_Start you are doing a recursive call (calling itself), this is not necessary and will cause a stack failure. App_Start is only for initialisation and your code should run off the end of App_Start. If a form is displayed your program will not end but will be there ready to respond to events. If no form is displayed your program will end on leaving App_Start.

Your delay routine is bad practice as it is using processor time unnecessarily by running in a loop. This starves other programs of processor cycles. You should be using a timer which takes no processor time when it is not executing code. Your code should look something like this

Code:
Sub Globals
	'Declare the global variables here.
End Sub

Sub App_Start
	' do initialisation here
	Form1.Show
	Timer1.enable ' timer set to appropriate delay
End Sub

Sub TimerTick
	' check for file
	If file Then
		print it
		delete it
	End If
End Sub
This has no means of stopping the program - but maybe you don't need to in a print server with no screen or keyboard.
Reply With Quote
  #17 (permalink)  
Old 12-29-2007, 06:14 AM
Junior Member
 
Join Date: Aug 2007
Location: Australia
Posts: 17
Default PageSetup under program control

Hi,

Nice library....

Anyways is there a way to programatically set or save what the user selects for printing using the pagesetup method. For example in my database reports, I always will want landscape, but most printers default to portrait. Also the margins are too much as well. It would be nice if I can set them under program control rather than have the users always having to select landscape etc etc.

Thanks.

Cheers.

M
Reply With Quote
  #18 (permalink)  
Old 12-29-2007, 11:15 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

Version 1.3 with Landscape, LeftMargin, RightMargin, TopMargin and BottomMargin properties. They may be set without displaying the print setup and should be honoured when printed. They may also be read back from the PrintSetup dialog after displaying it if the users' choices are required. Note that margins are always expressed as hundreths of an inch - even on metric systems. This explained in the help.
Attached Files
File Type: zip RichTextDesktop1.3.zip (19.5 KB, 13 views)
Reply With Quote
  #19 (permalink)  
Old 12-29-2007, 11:23 AM
Junior Member
 
Join Date: Aug 2007
Location: Australia
Posts: 17
Default

Hi,

Quote:
Originally Posted by agraham View Post
Version 1.3 with Landscape, LeftMargin, RightMargin, TopMargin and BottomMargin properties.
Thanks....I'll check it out tomorrow...Its getting late here and I should go to bed.

In the control I notice you can paste a bitmap image. I presume it paste's the bitmap where the current cursor is on the page? Also what is the simpliest way of getting a bitmap to the paste buffer. I have bitmaps in my database and having them printed out would be awesome.

Thanks gain.

Cheers.

M
Reply With Quote
  #20 (permalink)  
Old 12-29-2007, 12:08 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

Quote:
Originally Posted by markbarrett_1 View Post
Also what is the simpliest way of getting a bitmap to the paste buffer.
I tried adding a function to the library using the .NET Clipboard object but as it it is a wrapped COM component it wants to run in an STA environemt - which B4PPC isn't. I hit this same snag trying to wrap the WebBrowser so there are some things not easily done in a B4PPC library - and I mainly do easy
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 10:35 PM.


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