1"use strict";(self.webpackChunksnowtide_docs=self.webpackChunksnowtide_docs||[]).push([[5471],{5470:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"configuration-options","title":"Configuration options","description":"PDFxStream\'s configuration can be controlled in any of four ways:","source":"@site/docs/configuration-options.mdx","sourceDirName":".","slug":"/configuration-options","permalink":"/help/configuration-options","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"docs","previous":{"title":"Telemetry","permalink":"/help/telemetry"},"next":{"title":"Command-line usage","permalink":"/help/command-line-usage"}}');var i=o(4848),s=o(8453);const a={},r="Configuration options",l={},d=[{value:"Available configuration options",id:"available-configuration-options",level:2},{value:"<code>line.separator</code>",id:"lineseparator",level:3},{value:"<code>pdfxs.cjk.enable</code>",id:"pdfxscjkenable",level:3},{value:"<code>pdfxs.logfactory</code>",id:"pdfxslogfactory",level:3},{value:"<code>pdfxs.loggingtype</code>",id:"pdfxsloggingtype",level:3},{value:"<code>pdfxs.layout.detectTables</code>",id:"pdfxslayoutdetecttables",level:3},{value:"<code>pdfxs.telemetry</code>",id:"pdfxstelemetry",level:3}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"configuration-options",children:"Configuration options"})}),"\n",(0,i.jsx)(n.p,{children:"PDFxStream's configuration can be controlled in any of four ways:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Globally, by setting environment variables or Java system properties\n(before starting your application) that\n",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/pdf/Configuration.html",children:(0,i.jsx)(n.code,{children:"com.snowtide.pdf.Configuration"})})," uses to initialize its\ndefault instance. This is the most common approach."]}),"\n",(0,i.jsxs)(n.li,{children:["Globally, by changing the state of the default instance of\n",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/pdf/Configuration.html",children:(0,i.jsx)(n.code,{children:"Configuration"})}),", available via\n",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/pdf/Configuration.html#getDefault()",children:(0,i.jsx)(n.code,{children:"com.snowtide.pdf.Configuration.getDefault()"})})]}),"\n",(0,i.jsxs)(n.li,{children:["Locally, on a per-document (per-",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/pdf/Document.html",children:(0,i.jsx)(n.code,{children:"com.snowtide.pdf.Document"})}),") basis, by\nproviding a separate instance of\n",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/pdf/Configuration.html",children:(0,i.jsx)(n.code,{children:"Configuration"})}),", modified as desired, with\neach invocation of ",(0,i.jsx)("code",{children:"com.snowtide.PDF.open()"}),", e.g.\n",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/PDF.html#open(java.lang.String,byte[],com.snowtide.pdf.Configuration)",children:(0,i.jsx)(n.code,{children:"com.snowtide.PDF.open(String, byte[], Configuration)"})}),"."]}),"\n",(0,i.jsxs)(n.li,{children:["Changing the ",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/pdf/Configuration.html",children:(0,i.jsx)(n.code,{children:"Configuration"})})," on a particular ",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/pdf/Document.html",children:(0,i.jsx)(n.code,{children:"Document"})}),",\nvia ",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/pdf/Document.html#setConfig(com.snowtide.pdf.Configuration)",children:(0,i.jsx)(n.code,{children:"com.snowtide.pdf.Document.setConfig(Configuration)"})}),".\nNote that this will not affect configuration options that are only germane when a\ndocument is first being opened/initialized."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["PDFxStream checks environment variables and Java system properties\nonly once, when ",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/PDF.html",children:(0,i.jsx)(n.code,{children:"com.snowtide.PDF"})})," is statically initialized.\nTherefore, the safest way to set these configuration\noptions is to set the corresponding system properties when starting your\napplication:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"java \u2013cp [classpath] \u2013Dpdfxs.config.property=value your.main.classname\n"})}),"\n",(0,i.jsx)(n.p,{children:"Alternatively, you can set configuration options using environment\nvariables, using whatever facilities are provided by your operating\nsystem or shell for doing so."}),"\n",(0,i.jsx)(n.h2,{id:"available-configuration-options",children:"Available configuration options"}),"\n",(0,i.jsx)(n.h3,{id:"lineseparator",children:(0,i.jsx)(n.code,{children:"line.separator"})}),"\n",(0,i.jsxs)(n.p,{children:["Set this environment or system property to the string you want\nPDFxStream to use to separate lines in text extracts. This defaults to\nyour platform's default line separator: ",(0,i.jsx)(n.code,{children:"\\n"})," on Linux/Unix/Mac OS X,\nand ",(0,i.jsx)(n.code,{children:"\\r\\n"})," on Windows platforms."]}),"\n",(0,i.jsx)(n.h3,{id:"pdfxscjkenable",children:(0,i.jsx)(n.code,{children:"pdfxs.cjk.enable"})}),"\n",(0,i.jsxs)(n.p,{children:["Setting this environment or system property to ",(0,i.jsx)(n.code,{children:"N"})," will disable\nPDFxStream's ability to extract Chinese, Japanese, or Korean (CJK) text.\nThis may be desirable if memory utilization is a concern -- CJK\ncharacter maps are very large, and can consume significant amounts of\nmemory. As always, application profiling is recommended to determine the\nactual source(s) of memory consumption."]}),"\n",(0,i.jsx)(n.h3,{id:"pdfxslogfactory",children:(0,i.jsx)(n.code,{children:"pdfxs.logfactory"})}),"\n",(0,i.jsxs)(n.p,{children:["PDFxStream defaults to using ",(0,i.jsx)(n.code,{children:"java.util.logging"})," or Log4J for logging\ninformational and error messages. However, many environments require\ncustomized logging frameworks. Therefore, PDFxStream provides a\npluggable logging architecture that enables you to hook your custom\nlogging framework into PDFxStream. To do so, simply implement the\n",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/util/logging/LogFactory.html",children:(0,i.jsx)(n.code,{children:"com.snowtide.util.logging.LogFactory"})})," interface, and set the\n",(0,i.jsx)(n.code,{children:"pdfxs.logfactory"})," environment or system property to the full classname\nof your implementation."]}),"\n",(0,i.jsxs)(n.p,{children:["More details about PDFxStream's logging support is available\n",(0,i.jsx)(n.a,{href:"logging",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"pdfxsloggingtype",children:(0,i.jsx)(n.code,{children:"pdfxs.loggingtype"})}),"\n",(0,i.jsxs)(n.p,{children:["PDFxStream normally defaults to using the java.util.logging logging\nframework. To force PDFxStream to default to using Log4J, make sure\na log4j jar file is present on your application's classpath, and set the\n",(0,i.jsx)(n.code,{children:"pdfxs.loggingtype"})," environment variable or system property to ",(0,i.jsx)(n.code,{children:"log4j"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"pdfxslayoutdetecttables",children:(0,i.jsx)(n.code,{children:"pdfxs.layout.detectTables"})}),"\n",(0,i.jsxs)(n.p,{children:["By default, PDFxStream will attempt to detect tabular data on each\nextracted page, and infer the structure of each table. This structure is\nthen materialized as rows of ",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/pdf/layout/Block.html",children:(0,i.jsx)(n.code,{children:"com.snowtide.pdf.layout.Block"})}),"s\nwithin higher-level ",(0,i.jsx)(n.a,{href:"https://downloads.snowtide.com/javadoc/PDFxStream/latest/com/snowtide/pdf/layout/Table.html",children:(0,i.jsx)(n.code,{children:"com.snowtide.pdf.layout.Table"})})," blocks."]}),"\n",(0,i.jsxs)(n.p,{children:["This detection and inference can be disabled globally by setting the\n",(0,i.jsx)(n.code,{children:"pdfxs.layout.detectTables"})," environment or system property to ",(0,i.jsx)(n.code,{children:"N"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"pdfxstelemetry",children:(0,i.jsx)(n.code,{children:"pdfxs.telemetry"})}),"\n",(0,i.jsxs)(n.p,{children:["By default, PDFxStream's ",(0,i.jsx)(n.a,{href:"telemetry",children:"telemetry"}),' is on and "quiet" (i.e. it does not log\nanything about its activity unless there is a problem). Two other modes of operation are\navailable by setting the ',(0,i.jsx)(n.code,{children:"pdfxs.telemetry"})," environment variable or system property to one\nof:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Debug"}),", which will log the full payload of all telemetry communications for you to inspect,\nalong with any errors in handling the response from PDFxStream's telemetry backend."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Off"}),", which will disable PDFxStream's telemetry entirely. This option is only\navailable if PDFxStream has been initialized with a perpetual license file."]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,o)=>{o.d(n,{R:()=>a,x:()=>r});var t=o(6540);const i={},s=t.createContext(i);function a(e){const n=t.useContext(s);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.