Syntax

code

Function: NewBlankPage(const AName: WideString; AWidth, AHeight, ADPI: Integer; const AScale: WideString): IItem;

Description

Creates a blank page in the current job and returns the PAge Item that was created.

Code Reference

  • 1. Create a New Form application
  • 2. Add a button to the form
  • 3. add Planswift to reference (Planswift9_tlb in the uses)
  • 4. copy code to button onclick event

code

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

procedure TForm1.psNewBlankPage(Sender: TObject);

var

  ps: IPlanSwift;

  pg: IItem;

  note: IItem;

begin

//Create Planswift Interface

 ps := coPlanswift.Create;

 //Check to see if a job is open

 if not ps.IsJobOpen then begin

  ShowMessage('No Job Open');

  exit;

 end else begin

  //Create a new Blank page

   pg := ps.NewBlankPage('My New Page',36,24,200,'1/4"=1');

   //Draw a note on that page

   note := pg.NewItem('Note','My Page Note');

   // Set PAGEGUID on note so that it shows on the proper page

   note.SetPropertyFormula('PageGUID',pg.guid);

   //Set the note text

   note.SetPropertyFormula('Text','This is My New Page');

   //add first point on note

   note.NewPoint(0,0);

 end;

 //Free Planswift Interface

 ps := nil;

 

end;