junkcode  Check-in [e3b0d93b75]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove comment.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e3b0d93b7585cacba846303a549c8c13dca9ecbe7c9f348940e7815e6ea76b7c
User & Date: jaccarmac 2019-08-01 18:45:21.463
Context
2019-08-01
18:45
Line breaks. check-in: a6cafb1b84 user: jaccarmac tags: trunk
18:45
Remove comment. check-in: e3b0d93b75 user: jaccarmac tags: trunk
18:44
Sort text on page by x and y coords. check-in: b5d05a4c38 user: jaccarmac tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to pdf-invoice-extract/src/extract.cljs.
8
9
10
11
12
13
14
15
16
17
18
19
20
    (.extract (new PDFExtract)
              fn
              #js{}
              #(do (if %1
                     (println %1)
                     (put! data-chan %2)))) 
    (go (when-let [data (<! data-chan)]
          ;; the format we need to pull out is after a string content of "ea"
          ;; table fmt is "ea", name, type, # ordered, # shipped, id, # U/M, total price, retail price, extended price
          (map #(.-str %) (sort-by #(vector (.-y %) (.-x %)) (.-content (first (.-pages data)))))))))

(defn main [& cli-args]
  (go (println (<! (extract (first cli-args))))))







<
<




8
9
10
11
12
13
14


15
16
17
18
    (.extract (new PDFExtract)
              fn
              #js{}
              #(do (if %1
                     (println %1)
                     (put! data-chan %2)))) 
    (go (when-let [data (<! data-chan)]


          (map #(.-str %) (sort-by #(vector (.-y %) (.-x %)) (.-content (first (.-pages data)))))))))

(defn main [& cli-args]
  (go (println (<! (extract (first cli-args))))))