Re: [Tools-discuss] pages numbers in ToC in PDF

John Levine <johnl@taugh.com> Thu, 27 May 2021 20:03 UTC

Return-Path: <johnl@iecc.com>
X-Original-To: tools-discuss@ietfa.amsl.com
Delivered-To: tools-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C67EA3A0CEA for <tools-discuss@ietfa.amsl.com>; Thu, 27 May 2021 13:03:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.851
X-Spam-Level:
X-Spam-Status: No, score=-1.851 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=iecc.com header.b=KwtYYB5A; dkim=pass (2048-bit key) header.d=taugh.com header.b=SmAtqcHu
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sNMTCvyunBWD for <tools-discuss@ietfa.amsl.com>; Thu, 27 May 2021 13:03:46 -0700 (PDT)
Received: from gal.iecc.com (gal.iecc.com [IPv6:2001:470:1f07:1126:0:43:6f73:7461]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4236C3A0CE9 for <tools-discuss@ietf.org>; Thu, 27 May 2021 13:03:46 -0700 (PDT)
Received: (qmail 52954 invoked from network); 27 May 2021 20:03:42 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=iecc.com; h=date:message-id:from:to:cc:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:cleverness; s=ced8.60affb1e.k2105; bh=WI1SPPJk24BamDhXYuMvXFJjkFrZILujvSfvFBGdtoI=; b=KwtYYB5ASn/uguldAJYSXuXXq9pbg9X4E5n6asrsj07c+PYmyHDUTv9mB+MC4GQjyi3lJ9cnMqrXkLxUXjYETtSXAyaI23GEbUrZDA9JmdHtvOx7lyc6nIXOWnsENOXn3TfD+BHVbb/cjTvQbMCHkLsFTz/467W4zV81p0DT5DrmHciuJOX/LREDaZKFflCHXndgwh3yjA4u8YTZ5FC217y6HSYmgWi0R4hyrGq5pfMpcV/ASkAQ4FR6US0kUt2aCU0Tn9fbb6KOvXTs7QOqCgbEOBrCoXpiRdfACGcNexjwhXcnQMR2dtrc46UI87PmDeCTFBG21kNOChX4+PoBdA==
DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=taugh.com; h=date:message-id:from:to:cc:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:cleverness; s=ced8.60affb1e.k2105; bh=WI1SPPJk24BamDhXYuMvXFJjkFrZILujvSfvFBGdtoI=; b=SmAtqcHuotN0BDDAz2jHtCrMfmRijJUAw/IG58WYbj5XCfHZJHIF8til/VbAYaHhunaE14hBQ+lT+EqDgwZngbCuF3JXdoeZ8MDjYOiXLt6cVr9SfB0cfIJBwAXYndRkPYgSDFkP+3AHV/sH1DJ0ElUw3OC6HIHjw3SiJ+C6yON3MpgalzXlb0CW2przsUOMXQt4lIz1xTat+jH2BqsRuoMKhynvZtamk+DxgYuNLy8Jtxmyzm2lbTCDjbKY5nSbbkvpPVuFpWQEcfZ15dJk0TGOKdhhT8mE03sJe0guZuXrLgzKIoBAP/OSxtHxrDxwmEe3yD0rhVtkVisDQrzo8w==
Received: from ary.qy ([IPv6:2001:470:1f07:1126::78:696d:6170]) by imap.iecc.com ([IPv6:2001:470:1f07:1126::78:696d:6170]) with ESMTPS (TLS1.2 ECDHE-RSA AES-256-GCM AEAD) via TCP6; 27 May 2021 20:03:41 -0000
Received: by ary.qy (Postfix, from userid 501) id 4D2858D61D0; Thu, 27 May 2021 16:03:39 -0400 (EDT)
Date: Thu, 27 May 2021 16:03:39 -0400
Message-Id: <20210527200341.4D2858D61D0@ary.qy>
From: John Levine <johnl@taugh.com>
To: tools-discuss@ietf.org
In-Reply-To: <CAH0=7GW5fv73oyOfj-mgC7no3kjN+KNxF4hgOTg8Eihdfbp84Q@mail.gmail.com>
Organization: Taughannock Networks
X-Headerized: yes
Cleverness: minimal
Mime-Version: 1.0
Content-type: text/plain; charset="utf-8"
Content-transfer-encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/tools-discuss/BhK_4TtLk2zs6KO0mhHClH0qYsA>
Subject: Re: [Tools-discuss] pages numbers in ToC in PDF
X-BeenThere: tools-discuss@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: IETF Tools Discussion <tools-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tools-discuss>, <mailto:tools-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tools-discuss/>
List-Post: <mailto:tools-discuss@ietf.org>
List-Help: <mailto:tools-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tools-discuss>, <mailto:tools-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 27 May 2021 20:03:52 -0000

It appears that Bob Hinden  <bob.hinden@gmail.com> said:
>-=-=-=-=-=-
>
>I would also like the page numbers in the TOC.
>
>Not for printing, but when I look at a new draft, it quickly tells me how
>long it is.
>
>I don't see any downside to adding page numbers to the TOC.

Only if you promise to give $100 to the IETF Endowment any time you
mention a page number in a message to an IETF list.

Two points about page numbers in PDFs: I believe Carsten is correct, it'd take
two passes and double the time it takes to render the PDF.  I don't see this as
a terrible problem.

The key point is the one about page numbers being specific to a
rendering, and there's no canonical rendering. RFC 7995 suggested that
using paragraph numhers. It waffled about where they're visible, but
at least they stay the same among renderings. I suppose we could do
that, needing more like 1 1/2 passes to count and tag the paragraphs
if they aren't already tagged by the preptool.

xml2rfc uses a library called wasyprint to create the PDFs. It renders
HTML, using a tweaked version of the HTML output. That limits our
control over the output and is why the page breaks often look strange.
We knew about the limitations when we chose that approach, albeit
perhaps not just how bad the page breaks would be, because it is
vastly easier than the alternative of writing a PDF rendering engine.

R's,
John