WYSIWYG Printing

  1. 3 weeks ago

    Martin A

    Oct 25 Minneapolis, MN USA

    I am not exactly new to XoJo.
    I have written a few programs over the years as a hobby that relate to my part-time work as a sound engineer.

    My "real" job is as a commercial software developer for a forms processing company. We have a legacy program that was written in a combination of straight C, VB6, and C#. I am thinking about rewriting it using Xojo but I have a few questions.

    First, how well does Xojo do WYSIWYG? It is very important to be able to create and print a form exactly as it appears on the screen. I need to be able to measure the distance of some text on the form within a few TWIPS.

    Using the Windows RichText Control, I am able to accomplish a lot of what I do using windows messaging. Is that possible in Xojo (if still necessary)?

    The next requirement is that I can call a windows DLL. I don't think that will be a problem. The way it works now, the "real work" is done by our proprietary Windows DLL and that won't change. The current VB part is used kind of as a wrapper around the DLL along with form creation, database creation, reading and writing data, and reporting

    Lastly, the form processing part (much later in the project) creates Microsoft Access databases for data storage. Is that possible in Xojo? I need to be able to create dynamic databases (different db for each form), write the data and query that data to create reports.

    The original program took years to write. This is a huge undertaking. I'll be starting off with a few simple prototypes before I take the plunge.

    Thank you in advance for any advice you might have.

    -Marty

  2. Jeff T

    Oct 25 Midlands of England, Europe

    Printing is a bone of contention on Windows.. always has been.
    In very general, you can open a printer, and ask it how big the page is, and what the resolution is.
    GetStringWidth is the kind of call you can use to establish the size of text.

    I personally still use a quite old technique: I create a page-shaped picture and assemble all output on that, but at a greater size than the 72hpi version of the page you get 'by default'
    Then I throw that at the printer.

    I find PDF is a more understandable output - you tell it what size the page is,
    Dimensions are all in 72dpi, co-ordinates are decimal values.

    Switch from Access databases to SQLLite databases - the ability to use these is built in to Xojo and they are easy to use.
    You also don't need Access installed to make your app work.
    However, you may find that isnt suitable if 'reporting' is using the built in reporting tools from Access

    If VB can call your DLL, Xojo can too -( it will be a C DLL as opposed to one with C++ headers)
    Build for 32bit though - the DLL may not play nice with a 64bit build.

  3. Tim H

    Oct 25 Pre-Release Testers Portland, OR USA

    You can achieve accuracy to a single dot on the printer. Typically 1/300 inch or better on laser printers. But you have to do the math yourself. I have done very complex reports and can display on a canvas for preview, then print the exact same thing on a printer at whatever resolution the printer supports.

    Again: it's not exactly easy, but it is possible. I may have spent 6 months perfecting my printing subsystem.

  4. Jean-Yves P

    Oct 25 Pre-Release Testers, Xojo Pro Europe (France, Besançon)
    Edited 3 weeks ago

    I first tried to use the xojo report classes, but rapidly found that it is not flexible enough.
    so I started my own printing system, with a window class as a superobject
    and like Tim, some months later I have a full printing system, to print the way I want.
    It's completely usable, and I still have some possible improvements in mind...
    it's a lot of work, but it's self-rewarding, and you learn a lot doing like this.

  5. Martin A

    Oct 26 Minneapolis, MN USA

    @Jeff T I find PDF is a more understandable output - you tell it what size the page is,
    Dimensions are all in 72dpi, co-ordinates are decimal values.

    Does Xojo support PDF Files natively or do you use the PDF Printer in Windows? Third party?

    @Jeff T Switch from Access databases to SQLLite databases - the ability to use these is built in to Xojo and they are easy to use.
    You also don't need Access installed to make your app work.

    I'm not sure if switching is an option. Some customers use the data directly. The current version does not require that Access is be installed, but it does require MDAC for the Jet Engine.

    Thank you all for your replies.

  6. Jeff T

    Oct 26 Midlands of England, Europe

    Does Xojo support PDF Files natively

    No

    or do you use the PDF Printer in Windows? Third party?

    I personally use DynaPDFMBS plugin.
    But for your purposes, you can easily use a lighterweight system, such as this one: (others are available)

    http://www.rdsisemore.com/gpdf/index.html

  7. 2 weeks ago

    Martin A

    Oct 27 Minneapolis, MN USA

    @Tim H I have done very complex reports and can display on a canvas for preview, then print the exact same thing on a printer at whatever resolution the printer supports.

    Thanks, Tim but how do you determine the printer's supported resolution. The printer object in Xojo returns 72 X 72, doesn't it?
    Does Xojo support using a Handle to a Device Context to replicate the printer's metrics elsewhere?

    Thanks in advance

  8. Karen A

    Oct 27 Pre-Release Testers

    The only "printing" I do these days is by creating PDFs... In a web app they can be displayed in browsers and in a desktop simply launched (as long as a PDF viewer is installed, and who does not?)

    I use the PDF classes provided in the Einhugur plug in pack... The PDF capabilities are no where near as extensive as DynaPDF , but they meet my needs and IMO the price (And renewal price!) is very good for what you get.

    The other plugins provide a LOT useful functionality. Off the top my head they include common controls that should be but are not included in Xojo, extensive encryption capabilities , compression , barcode production and reading, the ability to create and read excel spreadsheets without excel (not as extensive a libPDF but again meets my needs), lots of picture processing stuff and some other things.

    You hear more about Monkeybread plugins here... IMO while there is some overlap overall and Monkeybread has more functionality in it's complete set, much of that tends to be at lower abstraction level than I am comfortable with and I don't need.

    I find Einhugur meets my key needs, for me in general is easier to use, and is cheaper for me given what I actually use.

    - karen

  9. Tim H

    Oct 27 Pre-Release Testers Portland, OR USA

    @Martin A Thanks, Tim but how do you determine the printer's supported resolution. The printer object in Xojo returns 72 X 72, doesn't it?
    Does Xojo support using a Handle to a Device Context to replicate the printer's metrics elsewhere?

    Thanks in advance

    While printing was somewhat broken for a few releases, afaik it's working again. You get the resolution in the printersetup and the graphics object is dimensioned larger or smaller based on the resolution. But I haven't tried it on the latest release. For a variety of reasons, I am still using an older version.

  10. Martin A

    Oct 30 Minneapolis, MN USA

    Using the RichText Control with VB6, I can call FormatRange with a printer's Device Context and print documents as good as Microsoft Word. To say my first attempt at printing with Xojo is a disappointment would be an understatement.

  11. Julian S

    Oct 30 Pre-Release Testers, Xojo Pro UK

    Anything other than printing to a default printer in Xojo is terrible at the moment. I would shudder if I had to implement a program that required a good set of printing features.

    All I can suggest is going here Feedback Case #51559, watching the video and add this to your feedback Top Cases and hope its implemented sooner rather than later. Its currently ranked 71st. If this can climb the ranks is might be looked at seriously.

    As for getting the DPI of the target printer I made a post about it here . I don't know if its been changed, fixed or implemented recently as I only tend to get involved in printing if someone has a problem with it so I've not got a working project to test things.

    All I can say regarding printing in Windows is good luck :)

  12. John M

    Oct 30 Pre-Release Testers, Xojo Pro New York / New Jersey

    All I can say regarding printing in Windows is good luck

    I'll second this opinion.

    My app does a huge amount of printing, and beginning in 2017 Xojo changed their Windows printing implementation. As of 2018R3 most of it now works, but printing anywhere within the printable area on the page is really tough because using the Page Setup dialog to get the page info returns the area determined by the margins the user inputs into that dialog, when what's needed is the complete page, as it does on the Mac.

    Sometime in the next few months, I am going to have to find a way around this problem, so far I haven't found a solution - even when using MBS plugins. I may have to dig into Windows declares...:(

  13. Markus W

    Oct 30 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...
    Edited 2 weeks ago

    Maybe Paul should do a webinar on how to do printing properly? After how many webinars isn’t it time to tackle some of the real issues that people have? Maybe Greg or Joe would like to do one?

  14. Pedro I

    Oct 30 Pre-Release Testers, Xojo Pro
    Edited 2 weeks ago

    Well, for WYSIWYG printing, it is possible on xojo 2016r4.1. For Xojo 2017 and on, they broke the printing framework.

    Reports are a joke on any version.

    For Access you can use the native ODBC, or The MBS Xojo SQL Plugin.

  15. Martin A

    Oct 31 Minneapolis, MN USA

    @Markus W Maybe Paul should do a webinar on how to do printing properly? After how many webinars isn’t it time to tackle some of the real issues that people have? Maybe Greg or Joe would like to do one?

    I was just thinking the same thing as I was navigating to this thread to see if anyone had replied. I do find some of the webinars useful but I think they are geared more toward the beginners. They are a good review but they never seem to tackle the more advanced topics. Maybe they figure the seasoned programmer will figure it out for themselves. At this point, I'm glad I asked before diving in. Maybe I should stick with C#. It's a great language too.

  16. @Martin A The best I have seen in WYSIWYG editing (there is no printing involved) is "custom-editfield" by Thomas Tempelmann, who is a well known developper for Xojo. It is also surprisingly fast. I think that transposing it to printing should not be too difficult.

  17. 7 days ago

    Julian S

    Nov 6 Pre-Release Testers, Xojo Pro UK

    @Julian S All I can suggest is going here Feedback Case #51559, watching the video and add this to your feedback Top Cases and hope its implemented sooner rather than later. Its currently ranked 71st. If this can climb the ranks is might be looked at seriously.

    It's 21st now, a few more points and it'll break into the top 20. Nice.

  18. 6 days ago

    Rolf G

    Nov 7 Pre-Release Testers, Xojo Pro Europe (Germany)

    @Julian S It's 21st now, a few more points and it'll break into the top 20. Nice.

    Here we go... 18th.

  19. Jean-Yves P

    Nov 7 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    here we go bis : rank 14th

  20. John M

    Nov 7 Pre-Release Testers, Xojo Pro New York / New Jersey

    12th now. Hopefully they can get this fixed soon!

  21. Newer ›

or Sign Up to reply!