#2 PDF Engine » Selecting visible buttons in preview form » 2014-12-22 14:02:57

Celery
Replies: 2

Hello!

Is it possible to choose which buttons are visible when calling ShowPreviewForm() ? For instance, if I'd like to hide the button labeled Print.
If there is no way to do this now, would it be something you can consider adding, please ?

Merry coding and happy new unit! wink

#3 Re: PDF Engine » Using different printer driver ? » 2014-06-26 13:56:40

Thanks you! Setting Printers.Printer.PrinterIndex helps. smile
When having ForceScreenResolution to true it didn't look good.

I considered converting the application to use TPdfDocument or TPdfDocumentGDI instead of TGDIPages. Would they also require setting PrinterIndex ?

#4 PDF Engine » Using different printer driver ? » 2014-06-25 13:43:18

Celery
Replies: 3

Hi!

I use TGDIPages to create a report and then export it to a PDF-file.

I noticed that papersize and font depends on default printer in Windows. Papersize I found that I could change by calling NewPageLayout(psa4), but I don't know how to affect the font used ? Maybe it's not the font, but "font-scaling" that's the problem. Anyway, the text looks different, and don't appear at the same place, if the default driver is "Generic/Text Only" compared to when another driver is chosen.
I thought I could set the property PrinterName to a desired printer, but realized it was a readonly property. I guess there's a reason for it ?

Which is the best way to solve this ?

Best regards.

#5 Re: PDF Engine » Question and possible bug (or installation problem?)?? » 2014-02-10 10:20:37

Hi!
Sorry for digging up an old thread.

Even if TGdiPages isn't a visual component I find it convenient to be able to assign properties and events at designtime and not having to do everything in code.

The "List index out of bounds" error can be avoided by adding an if-statement to the top of TGDIPages.PreviewPaint(). Here is my solution, in case someone else is interested, or if you'd like to add it to the official source code.

procedure TGDIPages.PreviewPaint(Sender: TObject);
var R: TRect;
    P1,P2: TPoint;
begin
  if csDesigning in ComponentState then
  begin
    R := fPreviewSurface.ClientRect;
    fPreviewSurface.Canvas.Brush.Color := Color;
    fPreviewSurface.Canvas.FillRect(R);
  end
  else
  begin
// Here goes existing code unchanged, except indented
  end;
end;

I've been using it with Delphi 7, XE2 and XE5 without any complications..... so far. smile

Board footer

Powered by FluxBB