Topics

PDF page numbering question (embedded pagination) #PDF

Erik
 

Hello everyone,

I have a customer that has asked about customizing the page numbers embedded in the PDF metadata. To be clear, I am not talking about customizing the page numbers as they are rendered in the PDF. I am talking about the actual page numbers that appear in the page number field in an application like Acrobat.

I believe they are currently editing these manually using Word, and I know how to set them in Acrobat by adding a prefix.

I am wondering if it is possible to somehow pass the fo:page-number information to Antenna House at publish time and have Antenna House also customize these page numbers at publish time without having to manually do so after the fact.

So far, I have not found any resources that say that this is even possible, let alone how to accomplish it. I'm hoping that someone here can at least tell me if this is at all possible... I don't need a solution (although that would be greatly appreciated!). I just need to know whether I'm on a fool's errand looking into this at all.

Even just a simple yes/no this is/isn't possible would help me get over this current block.

Thanks in advance!

Erik

Toshihiko Makita
 

Hi Erik,

I'm not sure what the concrete problem is.

If your question is about PDF, I believe that the PDF page count is stored in PDF file as the static data. But page count does not belong to metadata such like title, author, subtitle, keywords common in PDF documents. 

If your question is about Microsoft Word .docx, the page number is stored in docProps/app.xml such like below:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
    xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
    <Template>Normal.dotm</Template>
    <TotalTime>2291</TotalTime>
    <Pages>23</Pages>
    <Words>3752</Words>
    <Characters>21391</Characters>
    <Application>Microsoft Office Word</Application>
    <DocSecurity>0</DocSecurity>
    <Lines>178</Lines>
    <Paragraphs>50</Paragraphs>
    <ScaleCrop>false</ScaleCrop>
    ...
</Properties>

And this property is maintained by Microsoft Word itself. There is no need to maintain by authors.
What is your goal?

Regards,
-- 
/*---------------------------------------------------------------------- 
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 http://www.antenna.co.jp/
 http://www.antennahouse.com/
 ----------------------------------------------------------------------*/

David H
 

Hi Erik,

You might look at JavaScript, as Acrobat has very good support for it. It's possible to get and set page labels.

HTH,
David


Hello everyone,

I have a customer that has asked about customizing the page numbers embedded in the PDF metadata. To be clear, I am not talking about customizing the page numbers as they are rendered in the PDF. I am talking about the actual page numbers that appear in the page number field in an application like Acrobat.

I believe they are currently editing these manually using Word, and I know how to set them in Acrobat by adding a prefix.

I am wondering if it is possible to somehow pass the fo:page-number information to Antenna House at publish time and have Antenna House also customize these page numbers at publish time without having to manually do so after the fact.

So far, I have not found any resources that say that this is even possible, let alone how to accomplish it. I'm hoping that someone here can at least tell me if this is at all possible... I don't need a solution (although that would be greatly appreciated!). I just need to know whether I'm on a fool's errand looking into this at all.

Even just a simple yes/no this is/isn't possible would help me get over this current block.

Thanks in advance!

Erik_._,_._,_

Toshihiko Makita
 

On Sat, Apr 25, 2020 at 02:01 AM, Erik wrote:
I believe they are currently editing these manually using Word, and I know how to set them in Acrobat by adding a prefix.
If you want add some prefix for page-number:
  • cover-1
  • safety-3
You can specify fo:folio-prefix as the children of fo:page-sequence such like following:

    <fo:page-sequence master-reference="a4-master" reference-orientation="from-page-master-region()"
        writing-mode="from-page-master-region()" initial-page-number="1" force-page-count="even">
        <fo:folio-prefix>cover-</fo:folio-prefix>
        ...
    </fo:page-sequence>

or 

    <fo:page-sequence master-reference="a4-master" reference-orientation="from-page-master-region()"
        writing-mode="from-page-master-region()" initial-page-number="1" force-page-count="even">
        <fo:folio-prefix>safety-</fo:folio-prefix>
        ...
    </fo:page-sequence>

Hope this helps to improve your user's workflow.

Regards,

-- 
/*----------------------------------------------------------------------- 
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 http://www.antenna.co.jp/
 http://www.antennahouse.com/
 -----------------------------------------------------------------------*/ 

Larry Kollar
 

I used to do this in GNU Troff, about 10 years ago. Front matter was Roman numerals, then Chapter 1 began with page 1, and the page number in Acrobat tracked the page number in the footer. So you could type "xvii" in the page box in Acrobat and it would jump to that page in the front matter.

If it's not possible to do directly, either in FOP or Antenna House (or XEP, etc), it should be possible to hack the PDF with a script. But in that case, maybe we should be asking why our formatters can't handle it without intervention.