Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/remote/test/puppeteer/test/src/cdp/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  pdf.spec.ts

  Sprache: JAVA
 

Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

/**
 * @license
 * Copyright 2017 Google Inc.
 * SPDX-License-Identifier: Apache-2.0
 */

import {readFile, unlink} from 'fs/promises';

import expect from 'expect';

import {getTestState, setupTestBrowserHooks} from '../mocha-utils.js';

describe('Page.pdf', () => {
  setupTestBrowserHooks();

  it('can print to PDF with accessible', async () => {
    const {page, server} = await getTestState();

    const outputFile = __dirname + '/../../assets/output.pdf';
    const outputFileAccessible =
      __dirname + '/../../assets/output-accessible.pdf';
    await page.goto(server.PREFIX + '/pdf.html');
    await page.pdf({path: outputFile, tagged: false});
    await page.pdf({path: outputFileAccessible, tagged: true});
    try {
      const [base, tagged] = await Promise.all([
        readFile(outputFile),
        readFile(outputFileAccessible),
      ]);
      expect(tagged.byteLength).toBeGreaterThan(base.byteLength);
    } finally {
      await Promise.all([unlink(outputFile), unlink(outputFileAccessible)]);
    }
  });

  it('can print to PDF with outline', async () => {
    const {page, server} = await getTestState();

    const outputFile = __dirname + '/../../assets/output.pdf';
    const outputFileOutlined = __dirname + '/../../assets/output-outlined.pdf';
    await page.goto(server.PREFIX + '/pdf.html');
    await page.pdf({path: outputFile, tagged: true});
    await page.pdf({path: outputFileOutlined, tagged: true, outline: true});
    try {
      const [base, outlined] = await Promise.all([
        readFile(outputFile),
        readFile(outputFileOutlined),
      ]);

      expect(outlined.byteLength).toBeGreaterThan(base.byteLength);
    } finally {
      await Promise.all([unlink(outputFile), unlink(outputFileOutlined)]);
    }
  });
});

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet am  2026-04-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.