1
0
Fork 0

[add] bxs

This commit is contained in:
Andy Bunce 2025-02-01 21:35:09 +00:00
parent 0b8d565dac
commit 7447ca92be
3 changed files with 17 additions and 3 deletions

View file

@ -36,8 +36,8 @@ jobs:
- name: Build package - name: Build package
run: | run: |
basex scripts/make-fat-jar.xq basex scripts/install.bxs
- name: Run BaseX Tests - name: Run BaseX Tests
run: | run: |
bin/basex -t src/test basex -t src/test

5
scripts/install.bxs Normal file
View file

@ -0,0 +1,5 @@
# run query
RUN make-fat-jar.xq
REPO INSTALL dist/pdfbox-3.0.4.fat.jar
XQUERY file:copy("dist/pdfbox-3.0.4.fat.jar","/usr/local/basex/lib/custom/")
TEST src/test

View file

@ -28,7 +28,7 @@ declare namespace PDFRenderer="java:org.apache.pdfbox.rendering.PDFRenderer";
declare namespace RandomAccessReadBufferedFile = "java:org.apache.pdfbox.io.RandomAccessReadBufferedFile"; declare namespace RandomAccessReadBufferedFile = "java:org.apache.pdfbox.io.RandomAccessReadBufferedFile";
declare namespace File ="java:java.io.File"; declare namespace File ="java:java.io.File";
(:~ version of this package (:~ SemVer version of this package
with build metadata for Apacke Pdfbox in use e.g. "0.1.0+pdfbox3.0.4" with build metadata for Apacke Pdfbox in use e.g. "0.1.0+pdfbox3.0.4"
:) :)
declare function pdfbox:version() declare function pdfbox:version()
@ -36,6 +36,15 @@ as xs:string{
"0.1.0+pdfbox" || Q{java:org.apache.pdfbox.util.Version}getVersion() "0.1.0+pdfbox" || Q{java:org.apache.pdfbox.util.Version}getVersion()
}; };
(: open pdf,apply function, close pdf
with-document pattern, creates local pdfobject and ensures it is closed
e.g "path..." => pdfbox:with-pdf("path...",pdfbox:page-text(?,5))
:)
declare function pdfbox:with-pdf($src as xs:string,$fn as function(*)*)
as item()*{
"@TODO"
};
(:~ open pdf, returns pdf object :) (:~ open pdf, returns pdf object :)
declare function pdfbox:open($pdfpath as xs:string) declare function pdfbox:open($pdfpath as xs:string)
as item(){ as item(){