Giter Site home page Giter Site logo

label2pdf's Introduction

Introduction

This project is to generate a pdf file from images which is similar to Avery label generator. All you have to do it define a label page settings and image information in JSON.

Page Settings

Define your label paper format in JSON, say, page.json,


[
{
	"model" : "EU30147WJ",
	"description" : "onlinelabels.com EU30147WJ 70mm x 50mm",
	"paper" : { "name" : "A4", "unit" : "mm", "width": 210, "height": 297, "orientation": "P", 
  		    "top": 14, "bottom": 13, "left": 33, "right": 32, "columns" : 2, "rows" : 5,
		    "label_width": 70, "label_height": 50, "hspace": 5, "vspace": 5}
},
{
        "model" : "TAOBAO70x50",
        "description" : "TAOBAO 70mm x 50mm",
        "paper" : { "name" : "A4", "unit" : "mm", "width": 210, "height": 297, "orientation": "P",
        	    "columns" : 3, "rows" : 5, "top": 24, "bottom": 20, "left": 0, "right": 0,
		    "label_width": 70, "label_height": 50, "hspace": 1, "vspace": 1}
}
]

Image Settings in JSON

Define the images you want to print in JSON format (e.g. label.json). Image path with empty string will be skipped and leave a blank space on the pdf. The model name must be matched to one of the model defined in page.json.

{
	"model": "EU30147WJ",
	"image_type": "PNG",
	"images" : [["image1", "image2"], 
			["image3", "image4"],
			["image5", "image6"],
			["image7", "image8"],
			["image9", "image19"]
		]
}

Create label file

Create the pdf file by running the command line label2pdf

% label2pdf page.json label.json out.pdf

label2pdf's People

Contributors

vderic avatar

Watchers

Eric Lam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.