Recent

Author Topic: Setting page range in Printer Dialogue.  (Read 2381 times)

Hopestation

  • Full Member
  • ***
  • Posts: 181
Setting page range in Printer Dialogue.
« on: December 10, 2018, 01:41:55 pm »
Hi.
I am running Lazarus Version #: 1.8.0, FPC Version 3.0.4, SVN Revision56594, in Windows 64.

I want to print a set of pages within a document but I can't get the Printer Dialogue to provide this option. Pages is greyed out.

I've looked at the properties and there are "Page from" and "Page to" options, but if I set them they do nothing in the Dialogue.

How do I enable Page Numbers?

Thanks.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Setting page range in Printer Dialogue.
« Reply #1 on: December 10, 2018, 03:25:36 pm »
Set (or Include(), if in code) poPageNums in the dialog's Options.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Hopestation

  • Full Member
  • ***
  • Posts: 181
Re: Setting page range in Printer Dialogue.
« Reply #2 on: December 10, 2018, 04:06:13 pm »
Thanks Lucamar.

I am looking at the properties for TPrintDialog.

In Options, poPageNums has a box with a tick in it and (True) beside it, but it hasn't enabled Page Numbers in the dialog box when I double click the component on the form or in use at runtime.

That's why I am thinking that I need to do something more or there is a fault in the component.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Setting page range in Printer Dialogue.
« Reply #3 on: December 10, 2018, 05:34:37 pm »
Hummm ... I've just tested with Lazarus 1.8.4/FPC 3.0.4 (Linux-GTK2 and Windows XP) and it works correctly. Just to make sure, add this before your call Execute:
Code: Pascal  [Select][+][-]
  1.   MyPrintDialog.Options := [poPageNums];
  2.   MyPrintDialog.PrintRange := prPageNums;
  3.   { Alternatively, try:
  4.   MyPrintDialog.PrintRange := prSelection;
  5.   MyPrintDialog.Options := [poSelection];
  6.   }
  7.   if MyPrintDialog.Execute then
  8.     {Do your printing};
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Hopestation

  • Full Member
  • ***
  • Posts: 181
Re: Setting page range in Printer Dialogue.
« Reply #4 on: December 13, 2018, 05:26:46 pm »
Thanks again, Lucamar.

I've tried both your suggestions without success.

In Options I can turn on poSelection and poPrintToFile.

In the main properties setting Collate to True does nothing.

I notice that you are using version 1.8.4 could this be significant?

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Setting page range in Printer Dialogue.
« Reply #5 on: December 13, 2018, 08:23:04 pm »
In the main properties setting Collate to True does nothing.

Collate is very dependant of both the OS and the printer driver. Sometimes it does something, others does nothing.

Quote
I notice that you are using version 1.8.4 could this be significant?

I don't know, but it may. Look in the wiki, page: Lazarus 1.8 Fixes branch, although if it doesn't appear there it doesn't mean it was not changed somehow...

All I can tell is that in my machines (those cited previously, the Kubuntu 14 ones and a Windows 7 box) it does work just by setting poPageNums in Options.

I'm sorry I can't help you more :(
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Hopestation

  • Full Member
  • ***
  • Posts: 181
Re: Setting page range in Printer Dialogue.
« Reply #6 on: December 22, 2018, 11:44:19 am »
I am using a dual boot system, so I copied my code to the Linux Mint section and ran the program in Lazarus 1.8.0 there.

The dialog ran correctly, with all the features that are available in Properties being changeable.

Does this provide a clue to the cause of the problem in the Windows version?


 

TinyPortal © 2005-2018