#1 2012-05-22 15:04:49

Gregos
Member
Registered: 2012-05-11
Posts: 2

How set default view - fit to width ?

I try TPdfDestination but it's not work

Offline

#2 2012-05-22 15:09:56

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: How set default view - fit to width ?

How did you do?
Please provide some code to reproduce it.

The property shall be set before printing to the document, I suppose.

Offline

#3 2012-05-24 12:58:36

Gregos
Member
Registered: 2012-05-11
Posts: 2

Re: How set default view - fit to width ?

Pdf := TPdfDocumentGDI.Create;
  pdf.NewDoc;
  try
    Pdf.Info.Author        := 'Tester';
    Pdf.Info.CreationDate  := Now;
    Pdf.Info.Creator       := 'Tester';
    Pdf.ScreenLogPixels:=120;

    //pdf.PDFA1:=true;

    Pdf.ForceJPEGCompression:=90;
    Pdf.DefaultPaperSize   := psA4;

    Page := PDF.AddPage;
....
Canvas Draw
....
  Pdf.SaveToFile('test.pdf');
  finally
    Pdf.Free;
-----------------------------

PDF created fine, but when watching it fit to height in Acrobat Viewer.
When I open the document in Openoffice I can specify when you export the initial appearance - "fit to width" or "100%"

How to set it in synpdf?

Last edited by Gregos (2012-05-24 12:59:10)

Offline

#4 2012-05-24 14:49:14

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: How set default view - fit to width ?

Page layout is defined by a TPdfPageLayout constant.
You can use a Pdf.Root.PageLayout := plSinglePage.

Or the TPdfDestinationType kind of constant (more difficult).
In this case, use something like:

Pdf.Root.OpenAction := Pdf.CreateDestination;

+ set Pdf.Root.OpenAction properties.

Offline

Board footer

Powered by FluxBB