Page 1 of 1

2 questions, Reference Help, PDF and Block

Posted: 27 Jun 2015, 13:26
by Pascal07300
Hello

1 - TsgPDFExport.PageHeight
property PageHeight: Double;
Description
Indicates the height of the page of the output PDF file.

===> Which unit ? ( pixel, mm , other ? ) ?

+ how set dimension page ( portrait, landscape ? )

======== ==============================

TsgDXFBlock.AddEntity
Adds a new child entity.
function AddEntity(const AEntity: TsgDXFEntity): Integer; override;
Description
Call AddEntity to add a child entity.
===> Before ( Version 8 ) the result is boolean, not integer. In version 10, it s a integer.
Meaning of the return value ?

thanks / Pascal / FRANCE

Re: 2 questions, Reference Help, PDF and Block

Posted: 02 Jul 2015, 14:26
by support
Hello Pascal,

TsgPDFExport.PageHeight and TsgPDFExport.PageWidth are measured in millimeters, the default values are 297 mm and 210 mm, respectively. The page orientation can't be set explicitly, you should specify PageWidth and PageHeight instead.

TsgDXFBlock.AddEntity returns a number of entities in the block.


Mikhail

Re: 2 questions, Reference Help, PDF and Block

Posted: 04 Jul 2015, 12:27
by Pascal07300
Hello

" you should specify PageWidth and PageHeight instead. "

Problem: this property in read only:

TsgPDFExport = class(TsgSimpleExport)
private
FData: TpdfStrings;
.../...
property PageWidth: Double read FPageWidth;

==> READ ONLY ??
solution ??

Thanks / Pascal

Re: 2 questions, Reference Help, PDF and Block

Posted: 06 Jul 2015, 14:11
by support
Hello Pascal,

The PDF export parameters are set using the TsgPDFExport.ApplyParams procedure:

Code: Select all

procedure SaveToPDF(ACADImage: TsgCADImage; AFileName: string);
var
  vPDFExport: TsgPDFExport;
  vExportParams: TsgExportParams;
begin
  if not Assigned(ACADImage) then Exit;
  vPDFExport := TsgPDFExport.Create(ACADImage);
  try
    vExportParams := DefExportParams;
    vExportParams.PageWidth := 297;
    vExportParams.PageHeight := 210;
    vPDFExport.ApplyParams(vExportParams);
    vPDFExport.SaveToFile(AFileName);
  finally
    vPDFExport.Free;
  end;
end;
Mikhail