Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Home
- >
- FrameMaker
- >
- FrameMaker 2015 - ESTK - Page Size DefaultParams

Highlighted

Explorer
,

Mar 21, 2017

Copy link to clipboard

Copied

Hi everybody,

I'm struggling with the page sizes when creating a PDF file from a book. I can't manage to change the sizes of the pages to DIN A4. The default parameters seems to be 210,3 x 279,4 mm.

The same issue has been discussed for FDK, but I don't get how to adapt the code:

Framemaker 2015 - FDK Client application page size issue

Here is the function I use to save PDF with the attempt to alter the page height to 297mm:

I'm glad for any help.

function SaveAsPDF(book) {

var comp = book.FirstComponentInBook;

while(comp.ObjectValid()) {

var doc = SimpleOpen(comp.Name);

doc.PDFBookmark = true;

doc.DocAcrobatElements = false;

doc.PDFPageHeight = 297; // here is my attempt

comp = comp.NextBookComponentInDFSOrder;

}

var params = GetSaveDefaultParams();

var index = GetPropIndex(params, Constants.FS_FileType);

params[index].propVal.ival = Constants.FV_SaveFmtPdf;

book.Save(pdfPath, params, new PropVals());

}

Mentor

Hi FabianK007,

I think your accidental solution may be triggering some internal default... I don't know. It is probably not a great solution, though.

The thing about these height and width properties (among many other object properties in the object model) is that they use these "metric" units. It is a little tough to understand at first and maybe you don't really need to understand it fully. All you need is the proper conversion factor. To convert from metrics to millimeters, set the properties like this:

doc.PDFPageHeight = 297 * 185771;

doc.PDFPageWidth = 210 * 185771;

In other words, to convert from millimeters, multiply by 185771. This works in ExtendScript because the property is expressed as decimal integer. Below is an excerpt from the FDK manual that provides other conversion factors. Hope this helps some.

Russ

**Using MetricT values for linear measurements**

When used for linear measurement, a MetricT unit represents a point (1/72 inch). The

16 most significant bits of a MetricT value represent the digits before the decimal;

the 16 least significant bits represent the digits after the decimal. Therefore, 1 point is

expressed as hexadecimal 0x10000 or decimal 65536.

The following table lists the units of the measurement systems FrameMaker products

support and their MetricT equivalents.

TOPICS

Scripting

Community Guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Explorer
,

Mar 21, 2017

Copy link to clipboard

Copied

Hi everybody,

I'm struggling with the page sizes when creating a PDF file from a book. I can't manage to change the sizes of the pages to DIN A4. The default parameters seems to be 210,3 x 279,4 mm.

The same issue has been discussed for FDK, but I don't get how to adapt the code:

Framemaker 2015 - FDK Client application page size issue

Here is the function I use to save PDF with the attempt to alter the page height to 297mm:

I'm glad for any help.

function SaveAsPDF(book) {

var comp = book.FirstComponentInBook;

while(comp.ObjectValid()) {

var doc = SimpleOpen(comp.Name);

doc.PDFBookmark = true;

doc.DocAcrobatElements = false;

doc.PDFPageHeight = 297; // here is my attempt

comp = comp.NextBookComponentInDFSOrder;

}

var params = GetSaveDefaultParams();

var index = GetPropIndex(params, Constants.FS_FileType);

params[index].propVal.ival = Constants.FV_SaveFmtPdf;

book.Save(pdfPath, params, new PropVals());

}

Mentor

Hi FabianK007,

I think your accidental solution may be triggering some internal default... I don't know. It is probably not a great solution, though.

The thing about these height and width properties (among many other object properties in the object model) is that they use these "metric" units. It is a little tough to understand at first and maybe you don't really need to understand it fully. All you need is the proper conversion factor. To convert from metrics to millimeters, set the properties like this:

doc.PDFPageHeight = 297 * 185771;

doc.PDFPageWidth = 210 * 185771;

In other words, to convert from millimeters, multiply by 185771. This works in ExtendScript because the property is expressed as decimal integer. Below is an excerpt from the FDK manual that provides other conversion factors. Hope this helps some.

Russ

**Using MetricT values for linear measurements**

When used for linear measurement, a MetricT unit represents a point (1/72 inch). The

16 most significant bits of a MetricT value represent the digits before the decimal;

the 16 least significant bits represent the digits after the decimal. Therefore, 1 point is

expressed as hexadecimal 0x10000 or decimal 65536.

The following table lists the units of the measurement systems FrameMaker products

support and their MetricT equivalents.

TOPICS

Scripting

Community Guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

FabianK007

Mar 21, 2017
0
/t5/framemaker/framemaker-2015-estk-page-size-defaultparams/td-p/8874412
3
Replies
3

Explorer
,

Mar 21, 2017

Copy link to clipboard

Copied

Found something, I can't call it solution because I don't know why it works.

Setting the properties to 1 OR to 10 sets the format to A4.

Beside that -not part of the workaround- I applied the changes to the book instead of its components.

function SaveAsPDF(book) {

// to generate the pdf in din a4

// 0 = letter ?

// > 0 = din a4 no idea why...

book.PDFPageHeight = 1; //same results with 10

book.PDFPageWidth = 1; //same results with 10

var comp = book.FirstComponentInBook;

while(comp.ObjectValid()) {

var doc = SimpleOpen(comp.Name);

doc.PDFBookmark = true;

doc.DocAcrobatElements = false;

comp = comp.NextBookComponentInDFSOrder;

}

var params = GetSaveDefaultParams();

var index = GetPropIndex(params, Constants.FS_FileType);

params[index].propVal.ival = Constants.FV_SaveFmtPdf;

book.Save(pdfPath, params, new PropVals());

}

Community Guidelines

Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Reply

Loading...

FabianK007

Mar 21, 2017
0
/t5/framemaker/framemaker-2015-estk-page-size-defaultparams/m-p/8874413#M49416
Mentor
,

Mar 21, 2017

Copy link to clipboard

Copied

Hi FabianK007,

I think your accidental solution may be triggering some internal default... I don't know. It is probably not a great solution, though.

The thing about these height and width properties (among many other object properties in the object model) is that they use these "metric" units. It is a little tough to understand at first and maybe you don't really need to understand it fully. All you need is the proper conversion factor. To convert from metrics to millimeters, set the properties like this:

doc.PDFPageHeight = 297 * 185771;

doc.PDFPageWidth = 210 * 185771;

In other words, to convert from millimeters, multiply by 185771. This works in ExtendScript because the property is expressed as decimal integer. Below is an excerpt from the FDK manual that provides other conversion factors. Hope this helps some.

Russ

**Using MetricT values for linear measurements**

When used for linear measurement, a MetricT unit represents a point (1/72 inch). The

16 most significant bits of a MetricT value represent the digits before the decimal;

the 16 least significant bits represent the digits after the decimal. Therefore, 1 point is

expressed as hexadecimal 0x10000 or decimal 65536.

The following table lists the units of the measurement systems FrameMaker products

support and their MetricT equivalents.

Community Guidelines

Reply

Loading...

Russ Ward

Mar 21, 2017
2
/t5/framemaker/framemaker-2015-estk-page-size-defaultparams/m-p/8874414#M49417
frameexpert
LATEST

Adobe Community Professional
,

Mar 21, 2017

Copy link to clipboard

Copied

ExtendScript for FrameMaker uses a non-intuitive measurement system. There are 65536 "units" in a Postscript point. I like to work on points, so I usually set a constant in my script like this:

var PT = 65536;

So, if want to set something to 144 points wide, I simply use:

textFrame.Width = 144 * PT;

In your case, you can set a constant for millimeters. 1 millimeter is equal to 2.834645669 points , so you could use:

var MM = 65536 * 2.834645669;

Here is an example that sets the properties you want:

#target framemaker

var MM = 65536 * 2.834645669;

var doc = app.ActiveDoc;

doc.PDFPageWidth = 210 * MM;

doc.PDFPageHeight = 297 * MM;

Community Guidelines

Reply

Loading...

frameexpert

Mar 21, 2017
2
/t5/framemaker/framemaker-2015-estk-page-size-defaultparams/m-p/8874415#M49418
Using the Community
Experience League
Terms of Use
Privacy Policy
Cookie preferences
AdChoices
Language:

- Deutsch
- English
- Español
- Français
- 日本語コミュニティ
- Português

Copyright © 2020 Adobe. All rights reserved.