diff --git a/README.md b/README.md index 093db1a..d3707e8 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,12 @@ We recommed using [python-pdfkit](https://github.com/JazzCore/python-pdfkit) to You can find an example [here](examples/create_pdf.py) +## HTML Support + +The Lob.com API also supports HTML strings in leiu of a file of the above type. See below for examples of submitting with HTML strings. + +For templates and more information regarding HTML, please see the [Lob documentation](https://lob.com/docs/python#html-fonts). + ## Initialization and Configuration To initialize the wrapper, import `lob` and set the `api_key` @@ -321,6 +327,15 @@ lob.Object.create( double_sided=0 ) +#Create an Object using HTML +lob.Object.create( + name='Local File Object', + file='HTML here', + setting='100', + quantity=1, + double_sided=0 +) + #Create an Object using a file-like object. from StringIO import StringIO lob.Object.create( @@ -456,6 +471,14 @@ lob.Postcard.create( back = open('/path/to/local/file', 'rb') ) +#Create a Postcard Using HTML +lob.Postcard.create( + to_address=, + from_address=, + front = 'Front HTML', + back = 'Back HTML' +) + #Create Postcard with Message Instead of Back lob.Postcard.create( to_address = { @@ -644,6 +667,16 @@ lob.Area.create( full_bleed = '1' ) +#Basic Area Create with HTML +lob.Area.create( + name='Lob', + front = 'Front HTML', + back = 'Back HTML', + routes = ['94158','60031'], + target_type = 'all', + full_bleed = '1' +) + #Create Area with Optional Parameters lob.Area.create( front = 'https://s3-us-west-2.amazonaws.com/lob-assets/areafront.pdf',