All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pdf.pdf-text2pdf.venice Maven / Gradle / Ivy

There is a newer version: 1.12.34
Show newest version
;;;;   __    __         _
;;;;   \ \  / /__ _ __ (_) ___ ___
;;;;    \ \/ / _ \ '_ \| |/ __/ _ \
;;;;     \  /  __/ | | | | (_|  __/
;;;;      \/ \___|_| |_|_|\___\___|
;;;;
;;;;
;;;; Copyright 2017-2024 Venice
;;;;
;;;; Licensed under the Apache License, Version 2.0 (the "License");
;;;; you may not use this file except in compliance with the License.
;;;; You may obtain a copy of the License at
;;;;
;;;;     http://www.apache.org/licenses/LICENSE-2.0
;;;;
;;;; Unless required by applicable law or agreed to in writing, software
;;;; distributed under the License is distributed on an "AS IS" BASIS,
;;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;;;; See the License for the specific language governing permissions and
;;;; limitations under the License.

(do
  (ns test)

  (load-module :kira)

  ;; ensure PDF libs are available when loading this file
  (pdf/check-required-libs)



  ; define the template
  (def text
     """
     Lorem Ipsum is simply dummy text of the printing and typesetting
     industry. Lorem Ipsum has been the industry's standard dummy
     text ever since the 1500s, when an unknown printer took a galley
     of type and scrambled it to make a type specimen book. It has
     survived not only five centuries, but also the leap into electronic
     typesetting, remaining essentially unchanged. It was popularised in
     the 1960s with the release of Letraset sheets containing Lorem
     Ipsum passages, and more recently with desktop publishing
     software like Aldus PageMaker including versions of Lorem Ipsum.

     x
      x x
       x x
        x x
         x x
          x x x
     
     Lorem Ipsum is simply dummy text of the printing and typesetting
     industry. Lorem Ipsum has been the industry's standard dummy
     text ever since the 1500s, when an unknown printer took a galley
     of type and scrambled it to make a type specimen book. It has
     survived not only five centuries, but also the leap into electronic
     typesetting, remaining essentially unchanged. It was popularised in
     the 1960s with the release of Letraset sheets containing Lorem
     Ipsum passages, and more recently with desktop publishing
     software like Aldus PageMaker including versions of Lorem Ipsum.
     """)

  ; render the PDF, and save it
  (let [pdf (pdf/text-to-pdf text :font-size 10
                                  :font-weight 300
                                  :font-monospace false)]
    (io/spit "text2pdf-example.pdf" pdf)))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy