Commit 62c1f305 authored by Volker Krause's avatar Volker Krause
Browse files

Add custom extractor script to produce meaningful ticket names for BVG PDFs

parent bc2938ad
Pipeline #185650 passed with stage
in 2 minutes and 38 seconds
/*
SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
function parsePdfTicket(pdf, node, trigger) {
let ticket = trigger.result[0];
const text = pdf.pages[trigger.location].text;
ticket.name = text.match(/^(.*)\n/)[1];
return ticket;
}
{
"filter": [
{
"field": "issuerId",
"match": "6385",
"mimeType": "internal/vdv",
"scope": "Descendants"
}
],
"function": "parsePdfTicket",
"mimeType": "application/pdf",
"script": "bvg.js"
}
......@@ -35,6 +35,8 @@
<file>brusselsairlines.json</file>
<file>brusselsairlines.js</file>
<file>brusselsairlines-receipt.js</file>
<file>bvg.json</file>
<file>bvg.js</file>
<file>chaos-communication-congress.json</file>
<file>chaos-communication-congress.js</file>
<file>czechrailways.json</file>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment