2 questions, Reference Help, PDF and Block

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
Pascal07300
Posts: 5
Joined: 26 Jun 2015, 18:10

2 questions, Reference Help, PDF and Block

Post by Pascal07300 » 27 Jun 2015, 13:26

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

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: 2 questions, Reference Help, PDF and Block

Post by support » 02 Jul 2015, 14:26

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Pascal07300
Posts: 5
Joined: 26 Jun 2015, 18:10

Re: 2 questions, Reference Help, PDF and Block

Post by Pascal07300 » 04 Jul 2015, 12:27

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

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: 2 questions, Reference Help, PDF and Block

Post by support » 06 Jul 2015, 14:11

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply