Problem With printing a file

jothis

Active Member
Licensed User
hi friends

i wish to create a printing function for my desktop application.
i used the desktop only.dll file. and i used this code:-

printer.New1
printer.PrintFile(AppPath&"\01.jpg")

when i run my program print function is executing successfully but the output of the print is not the image i selected. i got three pages with fully encrypted text. i searched the basic4ppc help page. i got this statement from there Printing is done with PrintFile which prints a text file and PrintString which prints a given string. but i want to print a selected image or document.
can you help me?
jothis
:sign0085:
 

mjcoon

Well-Known Member
Licensed User
I suggest that you find a PC application that will accept a command-line string which specifies that a named file is to be printed on the default printer.

I cannot suggest such a program but you can do your own searches. Once you have found and installed it then call it using the "Shell()" command.

HTH, Mike.
 

jothis

Active Member
Licensed User
Thank you for helping me agraham.

I thing you don't understand what i want. I Looked Your Richtextbox Library it is nice.
This is My Problem is

I have a folder named images and many jpg images on this folder. And I Created a table named images i listed the image names to this table. And I have a button Print. When I Select a row in a table and click on the print button i want to print the selected image

I thing you understood my problem
jothis
 

agraham

Expert
Licensed User
Longtime User
I did understand what you want to do.

When the print button is pressed read the image into a Bitmap. Use CopyImageToClipboard to get the image to the Clipboard, Use PasteBitmap to get it into a document and then print it from there. The demo file with the library shows how to print.

You could also use my http://www.b4x.com/forum/additional...ktop-graphics-printing-library.html#post20467 which handles graphics and images more elegantly than RichTextDesktop and use a DrawerEx to draw an image to the page to be printed.
 

jothis

Active Member
Licensed User
Thank you for help agraham

I Do it But My Application Is Reporting A Error Message
Please See My Code
Jothis
 

Attachments

  • printimage.sbp
    724 bytes · Views: 197
Cookies are required to use this site. You must accept them to continue using the site. Learn more…