[mod] hardcore jars
This commit is contained in:
parent
ce70157303
commit
47a2aa2901
3 changed files with 20 additions and 10 deletions
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"name": "pdfbox",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"description": "A BaseX interface to Apache Pdfbox version 3",
|
||||
"main": "src/Pdfbox3.xqm",
|
||||
"homepage": "https://github.com/npm/example#readme",
|
||||
"homepage": "https://github.com/expkg-zone58/pdfbox#readme",
|
||||
"directories": {
|
||||
"doc": "docs"
|
||||
},
|
||||
|
@ -22,7 +22,6 @@
|
|||
"expkg_zone58": {
|
||||
"namespace": "org.expkg_zone58.Pdfbox3",
|
||||
"main-class": "org.apache.pdfbox.pdmodel.PDDocument",
|
||||
"download": "jars/",
|
||||
"maven": [
|
||||
"org/apache/pdfbox/pdfbox/3.0.4/pdfbox-3.0.4.jar",
|
||||
"org/apache/pdfbox/pdfbox-io/3.0.4/pdfbox-io-3.0.4.jar",
|
||||
|
|
|
@ -128,7 +128,7 @@ let $src:=$build:PKG?expkg_zone58?maven=>array:flatten()
|
|||
let $names:= $src!replace(.,"^.*/","")
|
||||
return switch($style)
|
||||
case "name" return $names
|
||||
case "download" return $names!concat($build:PKG?expkg_zone58?download,.)
|
||||
case "download" return $names!concat("jars/",.)
|
||||
case "content" return $names!concat("content/",.)
|
||||
default return $src
|
||||
};
|
||||
|
|
|
@ -97,7 +97,7 @@ as xs:base64Binary{
|
|||
keys are property names,
|
||||
values are sequences of functions to get property from $pdf object
|
||||
:)
|
||||
declare %private variable $pdfbox:doc-info:=map{
|
||||
declare %private variable $pdfbox:property-map:=map{
|
||||
"pages": pdfbox:page-count#1,
|
||||
|
||||
"hasOutline": pdfbox:hasOutline#1,
|
||||
|
@ -133,10 +133,16 @@ declare %private variable $pdfbox:doc-info:=map{
|
|||
pdfbox:gregToISO#1)
|
||||
};
|
||||
|
||||
(:~ known property names sorted :)
|
||||
declare function pdfbox:defined-properties()
|
||||
as xs:string*{
|
||||
$pdfbox:property-map=>map:keys()=>sort()
|
||||
};
|
||||
|
||||
(:~ return value of $property for $pdf :)
|
||||
declare function pdfbox:property($pdf as item(),$property as xs:string)
|
||||
as item()*{
|
||||
let $fns:= $pdfbox:doc-info($property)
|
||||
let $fns:= $pdfbox:property-map($property)
|
||||
return if(exists($fns))
|
||||
then fold-left($fns,
|
||||
$pdf,
|
||||
|
@ -147,16 +153,21 @@ as item()*{
|
|||
(:~ summary CSV style info for all properties for $pdfpaths :)
|
||||
declare function pdfbox:report($pdfpaths as xs:string*)
|
||||
as map(*){
|
||||
pdfbox:report($pdfpaths,map:keys($pdfbox:doc-info))
|
||||
pdfbox:report($pdfpaths,map:keys($pdfbox:property-map))
|
||||
};
|
||||
|
||||
(:~ summary CSV style info for named properties for $pdfpaths :)
|
||||
declare function pdfbox:report($pdfpaths as xs:string*, $properties as xs:string*)
|
||||
as map(*){
|
||||
map{"names": array{$properties},
|
||||
map{"names": array{"path",$properties},
|
||||
|
||||
"records": for $pdf in $pdfpaths!pdfbox:open-file(.)
|
||||
return array{$properties!pdfbox:property($pdf, .)}
|
||||
"records": for $path in $pdfpaths
|
||||
let $pdf:=pdfbox:open-file($path)
|
||||
return fold-left($properties,
|
||||
array{$path},
|
||||
function($result as array(*),$prop as xs:string){
|
||||
array:append($result, string(pdfbox:property($pdf, $prop)))}
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue