Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Jul 22, 2014 2:27 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Printing under linux
PostPosted: Tue Mar 08, 2011 6:19 am 
Offline

Joined: Fri Apr 16, 2010 2:21 am
Posts: 38
First: I'm new to RB so don't shoot me if I oversee something obvious :oops:

I'm in the process of porting my first app from Superbase to Realbasic. All was going well until it came to printing...

I'm on 64bit ArchLinux (multilib installed) with KDE 4.6 as Destop Environment and REALStudio 2010r5.1. There seem to be some 'oddnesses'. I designed a Report according to the examples and tried to print it.

My local laser (Brother MFC9420CN) won't print at all, but that seems to be a buggy driver which won't work from gnome apps. Had the same thing with openoffice some time ago. While they seemed to have worked around it by now, RB obviously has not.

So I tried my virtual pdf printer installed in CUPS. The Report prints. But it seems to print at very low dpi and therefore looks very ugly. I tried to set maxHorizontalResolution and MaxVerticalResolution to 300, even 600 but it seems to be completely ignored.

As far as I understand there have been some some bugs in the linux printing area. The docs even say that some things don't exist in linux. That seems to be outdated by now as I can display the PrinterSetup.
http://docs.realsoftware.com/index.php/PrinterSetup

But I need some hints. How do you linux guys manage your printouts?

Harvey

_________________
Linux is like a wigwam: No Gates, no Windows and an Apache inside


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Tue Mar 08, 2011 4:41 pm 
Offline

Joined: Mon Oct 06, 2008 12:35 pm
Posts: 37
the problem with linux printing resolution supposed was fixed in Rb2011r1, the other way to print is use RsReports http://www.rothsoft.ch/realbasic/rsreport/ and save all page in PDF format and print from any PDF viewer.


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Wed Mar 09, 2011 4:45 am 
Offline

Joined: Fri Apr 16, 2010 2:21 am
Posts: 38
George,
georgelbs wrote:
the problem with linux printing resolution supposed was fixed in Rb2011r1

downloading now (the notification mail about the new release came in today) :D

georgelbs wrote:
the other way to print is use RsReports http://www.rothsoft.ch/realbasic/rsreport/ and save all page in PDF format and print from any PDF viewer.

I will examine this.

I was really frightened when I saw the printing results. At least I put some weeks of learning in this project by now.

Thank you
Harvey

_________________
Linux is like a wigwam: No Gates, no Windows and an Apache inside


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Thu Mar 24, 2011 1:20 pm 
Offline
User avatar

Joined: Tue Jan 26, 2010 1:33 pm
Posts: 32
Location: Nova Scotia, Canada
REALBasic cannot print from Linux, unless you consider 72 DPI and high latency to be acceptable. This is not fixed in 2011R1 although it does have a new set of bugs ;)

I understand that getting this resolved is now a priority with RealSoftware.

After looking at various approaches, we decided to go our own way on it. Presently we print from Linux applications by generating Postscript output into a text file, which is then spooled out to the printer or viewed using whatever postscript viewer the distribution provides. We have this working to a limited extent now in some stuff we use in-house. It is promising, although a lot of work to devise a totally reusable object model that can be applied to different requirements.

RSReport Designer is supplied "as is" and is undocumented. We looked at this but opted for the the Postscript approach.

_________________
REALStudio Enterprise 2011r4.1
Linux Mint 11
MS WIn 7 / XP


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Fri Mar 25, 2011 3:10 am 
Offline

Joined: Fri Apr 16, 2010 2:21 am
Posts: 38
BeeGee56 wrote:
REALBasic cannot print from Linux, unless you consider 72 DPI and high latency to be acceptable. This is not fixed in 2011R1 although it does have a new set of bugs ;)

I use 2011R1 by now and my issues seem to be solved although I have not extremely tested it 8)
At least the 72 dpi issue seems to be gone.

BeeGee56 wrote:
After looking at various approaches, we decided to go our own way on it. Presently we print from Linux applications by generating Postscript output into a text file

This sounds like a lot of work too. My opinion is if I buy something like REALStudio it should be capable of printing without any additional software :cry: The IDE should wrap around the OSes printing possibilities and should present a set of routines usable on all of them... That is the idea behind being cross-platform, isn't it?

BeeGee56 wrote:
RSReport Designer is supplied "as is" and is undocumented. We looked at this but opted for the the Postscript approach.

I had a look but this seems a bit too complicated for a beginner like me. First I should try to understand REALStudio itself :wink:

Thanks for your input
Harvey

_________________
Linux is like a wigwam: No Gates, no Windows and an Apache inside


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Thu Mar 31, 2011 11:09 am 
Offline
User avatar

Joined: Tue Jan 26, 2010 1:33 pm
Posts: 32
Location: Nova Scotia, Canada
harvey wrote:
I use 2011R1 by now and my issues seem to be solved although I have not extremely tested it 8)
At least the 72 dpi issue seems to be gone.


I appreciate your observations on that, Harvey. All the testing we did here on 2011R1 was on Slackware 13.1 and Zenwalk. In view of your experience, we decided to see what kind of results we get using an Ubuntu-based distro.

More when I know more :wink:

_________________
REALStudio Enterprise 2011r4.1
Linux Mint 11
MS WIn 7 / XP


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Fri Apr 01, 2011 2:16 am 
Offline

Joined: Fri Apr 16, 2010 2:21 am
Posts: 38
BeeGee56 wrote:
All the testing we did here on 2011R1 was on Slackware 13.1 and Zenwalk. In view of your experience, we decided to see what kind of results we get using an Ubuntu-based distro.

I use Archlinux, a rolling release distro (http://www.archlinux.org) as it gives me more flexibility and is always up-to-date concerning software. Right now I use kernel 2.6.38.2 with KDE4.6.1 and firefox 4.0 as a browser 8)

Harvey

_________________
Linux is like a wigwam: No Gates, no Windows and an Apache inside


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Wed Apr 06, 2011 2:12 pm 
Offline
User avatar

Joined: Tue Jan 26, 2010 1:33 pm
Posts: 32
Location: Nova Scotia, Canada
My initial pessimism on this issue in 2011r1 was incorrect.

Printing under Linux from the Reports facility does indeed appear to be working. :D :D

The main issue we noted today was that in Linux, print positions appear to be relative to the printer's left or top margin, whereas in Windows they appear to be relative to the physical edge of the page.

We had been testing it by calling the DrawString of the Graphics object. This is still problematic in that the font size changes inversely to the DPI print resolution in use. Or it may be that our test proggie is misusing the Graphics object.

I would not say that printing is truly independant of the operating system yet, but there has obviously been considerable progress made in this area.

Good on ya, Real Software.

_________________
REALStudio Enterprise 2011r4.1
Linux Mint 11
MS WIn 7 / XP


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Wed Apr 06, 2011 2:16 pm 
Offline
User avatar

Joined: Tue Jan 26, 2010 1:33 pm
Posts: 32
Location: Nova Scotia, Canada
Oh, and further to that, I neglected to mention that this was tested on a relatively plain vanilla Slackware 13.1 system (k. 2.6.33). Slackware systems are fairly basic out of the box and I would have considerable optimism about the results on other Linux distros.
Happy coding, all.

_________________
REALStudio Enterprise 2011r4.1
Linux Mint 11
MS WIn 7 / XP


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Thu Apr 07, 2011 4:02 pm 
Offline

Joined: Mon Jan 22, 2007 9:47 am
Posts: 131
DPI is one thing...

...the more important one seems to be:
<feedback://showreport?report_id=7721>


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Fri Apr 08, 2011 2:18 am 
Offline

Joined: Fri Apr 16, 2010 2:21 am
Posts: 38
jraess wrote:
DPI is one thing...

...the more important one seems to be:
<feedback://showreport?report_id=7721>


Could you please, please clarify for those of us who can't access the feedback app - iE. me ?

Thank you
Harvey

_________________
Linux is like a wigwam: No Gates, no Windows and an Apache inside


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Fri Apr 08, 2011 5:38 am 
Offline
User avatar

Joined: Tue Jan 26, 2010 1:33 pm
Posts: 32
Location: Nova Scotia, Canada
Harvey:
Here's the text of that Feeback issue:
Quote:
7721: Linux: use Cairo for 2D graphics
Description:
The current Vector Graphics library is incredibly outdated (almost to an embarrassing degree). This, on Linux, could be rectified by utilizing Cairo or Clutter.

Cairo: http://en.wikipedia.org/wiki/Cairo_(graphics)
Clutter: http://clutter-project.org/

Steps to Reproduce:
Run the existing Vector Graphic sample code on Linux. Not the massively jagged and old-looking graphics. Take note of the very poor speed.

_________________
REALStudio Enterprise 2011r4.1
Linux Mint 11
MS WIn 7 / XP


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Thu Apr 14, 2011 1:19 pm 
Offline
User avatar

Joined: Tue Jan 26, 2010 1:33 pm
Posts: 32
Location: Nova Scotia, Canada
One more thing you may encouter is what appears to be an issue where calling the Document.Print method of a Report object to print it only prints the first page of a multi-page report. I got this on Slackware and Ubuntu but not on Windows.

Here is a workaround:
Instantiate a Picture object and iterate through the report's Document.Page collection, which returns an image. Set your picture object to this and call DrawPicture on the picture object.
I do not explain well so here's a code example:

Where:
pRpt: The RB report object
pRS: The recordset the report is reporting
pPS: A PrinterSetup object
pGrfx: The graphics object returned by OpenPrinterDialog(pPS)

If pRpt.Run( pRS, pPS ) Then
Dim pPic As Picture
Dim pX As Integer
Dim pN As Integer
pN = pRpt.Document.PageCount
For pX = 1 To pN
pPic = pRpt.Document.Page(pX)
pGrfx.DrawPicture (pPic,0,0)
If pX < pN then
pGrfx.NextPage
End If
Next pX
End If


Haven't checked this with Feedback to see if it's a reported bug so I apologise if I'm being redundant.

Have a good weekend, all.
BG

_________________
REALStudio Enterprise 2011r4.1
Linux Mint 11
MS WIn 7 / XP


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Wed Oct 12, 2011 11:05 am 
Offline

Joined: Fri Apr 16, 2010 2:21 am
Posts: 38
first of all, thank you BG for providing a fast workaround. It saved my life :D
But now I am using 2011r3 and RB still only prints the first page of a multi-page report. Has anybody put a bug report into feedback? I can't do that because the feedback app won't run on my 64 bit system. If there is a bug report what is the status?

Harvey

_________________
Linux is like a wigwam: No Gates, no Windows and an Apache inside


Top
 Profile  
 
 Post subject: Re: Printing under linux
PostPosted: Wed Oct 26, 2011 9:45 pm 
Offline
User avatar

Joined: Thu Nov 15, 2007 4:07 am
Posts: 313
Location: 't Zand, The Netherlands
Working with 2011r3 and Mint 10 Julia, I can print 300 dpi without any problem:

dim Printer_Setup as PrinterSetup
dim Printer_Graphics as Graphics

Printer_Setup = new PrinterSetup

// set the resolution to 300 DPI for printing
Printer_Setup.MaxHorizontalResolution = 300
Printer_Setup.MaxVerticalResolution = 300

if Printer_Setup.PageSetupDialog() = false then
return //exit method
end if

Printer_Graphics = OpenPrinter(Printer_Setup)
if Printer_Graphics = nil then
return //exit method
end if

dim mag as single = Printer_Setup.MaxHorizontalResolution / 72

Printer_Graphics.TextFont = "Courier New"
Printer_Graphics.TextSize = 16 * mag

// etc...

_________________
Debian Sqeeze - Real Studio 2011r4
You have to have a little programming fun every day!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group