<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Public Notification - Avery Label 5160 Aligning Issues in State &amp; Local Government Questions</title>
    <link>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398300#M2434</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;BTW, The staff loves this new application.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Jul 2013 17:07:11 GMT</pubDate>
    <dc:creator>JeremyWilliams</dc:creator>
    <dc:date>2013-07-31T17:07:11Z</dc:date>
    <item>
      <title>Public Notification - Avery Label 5160 Aligning Issues</title>
      <link>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398294#M2428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been working on the Public Notification app for 10.1.&amp;nbsp; Everything is working, but when the 5160 label is generated, and printed on a 5160 Avery sheet, the labels dont line up.&amp;nbsp; The first few rows of each sheet are ok, but by the bottom of each page the labels are very far off.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&amp;nbsp; Check out the attachment, this is a label creation from the app.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 19:52:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398294#M2428</guid>
      <dc:creator>JeremyWilliams</dc:creator>
      <dc:date>2013-06-20T19:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Public Notification - Avery Label 5160 Aligning Issues</title>
      <link>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398295#M2429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeremy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for reporting the problem; I'm able to reproduce it and we will work on it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 21:13:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398295#M2429</guid>
      <dc:creator>MikeTschudi</dc:creator>
      <dc:date>2013-06-24T21:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Public Notification - Avery Label 5160 Aligning Issues</title>
      <link>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398296#M2430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeremy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to let you know that part of our team is fixing the problem now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 02:08:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398296#M2430</guid>
      <dc:creator>MikeTschudi</dc:creator>
      <dc:date>2013-06-27T02:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Public Notification - Avery Label 5160 Aligning Issues</title>
      <link>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398297#M2431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was also having some major alignment issues with this.&amp;nbsp; I used the function for the 5160 script and made some modifications.&amp;nbsp; I have now successfully got it to line up with the 5160 format.&amp;nbsp; Here is the function with modifications to the python script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
from reportlab.lib.units import inch
import os, glob, sys, time
import textwrap

#Logic for averyLabel 5160
def avery5160(outfile, font, font_size, addressInput):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Creating labels in Avery 5160 format'
&amp;nbsp;&amp;nbsp;&amp;nbsp; # PDF vars
&amp;nbsp;&amp;nbsp;&amp;nbsp; if os.path.exists(outfile):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.remove(outfile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_pdf = canvas.Canvas(outfile, pagesize = letter)
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_pdf.setFont(font, font_size)
&amp;nbsp;&amp;nbsp;&amp;nbsp; addressItem = addressInput.split('$')
&amp;nbsp;&amp;nbsp;&amp;nbsp; hs = 0.25
&amp;nbsp;&amp;nbsp;&amp;nbsp; vs = 10.3
&amp;nbsp;&amp;nbsp;&amp;nbsp; horizontal_start = hs * inch #staring point of label horizontally
&amp;nbsp;&amp;nbsp;&amp;nbsp; vertical_start = vs * inch #starting point of label vertically
&amp;nbsp;&amp;nbsp;&amp;nbsp; count = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #initially the count is 0

&amp;nbsp;&amp;nbsp;&amp;nbsp; for item in addressItem:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if count &amp;gt; 0 and count % 30 == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_pdf.showPage()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_pdf.setFont(font, font_size)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; horizontal_start = hs * inch
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vertical_start = vs * inch
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif count &amp;gt; 0 and count % 10 == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; horizontal_start = horizontal_start + 2.8 *inch
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vertical_start = vs * inch

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label = out_pdf.beginText()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label.setTextOrigin(horizontal_start, vertical_start)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; details = item.split('~')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for detail in details:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(detail) &amp;gt; 45:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = detail[0:44]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label.textLine(name)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = detail[44:60]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label.textLine(name)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label.textLine(detail)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_pdf.drawText(label)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vertical_start = vertical_start - 1.05 * inch&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count = count + 1

&amp;nbsp;&amp;nbsp;&amp;nbsp; out_pdf.showPage()
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_pdf.save()
&amp;nbsp;&amp;nbsp;&amp;nbsp; print '\nCreated %s\n' %outfile
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have this working together with another script to generate labels (I'm not using it as part of a JS web map service) for the staff in the Assessor's office for my county.&amp;nbsp; The staff runs a query on parcels they want mailing addresses for and I have a dictionary that pulls the addresses out for the selected parcels and puts them in a text file and generates the labels using the above script.&amp;nbsp; It took a lot of playing around with the numbers, but finally just got it working properly this morning.&amp;nbsp; Here's the pdf:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: I just want to add a small disclaimer.&amp;nbsp; This works well in my unique situation and I am not sure how well it would work in other situations.&amp;nbsp; I have this as part of a script that works with another script that builds a text file to add the proper delimiters, etc.&amp;nbsp; I was using a relatively small font (size 9) with the 'Helvetica' typeface.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I spent a lot of time playing around with the different intervals(and banging my head against the desk) to ensure the text was properly fitted inside all the slots for the Avery 5160 sheet with my specific fontsize/type.&amp;nbsp; So my advice to anyone else is to just kind of play around with it and see what kind of outputs you get.&amp;nbsp; One thing I know, I am definitely sick of looking at this code! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:12:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398297#M2431</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T18:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Public Notification - Avery Label 5160 Aligning Issues</title>
      <link>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398298#M2432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As Mike mentioned, we have been actively working on a resolution to this issue and we'll be shipping a new version of the scripts with our 10.2 release.&amp;nbsp; The new versions include changes we've made to improve alignment with 5160 labels.&amp;nbsp; We have tested these changes on several different printers and believe we have a solution that will work for most, but there may still be cases where you need to "tune" the scripts to work with your specific printers.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeremy - thank you for pointing bug out.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Caleb - thank you for the sample code, it really helped us narrow down the problem and improve the scripts.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 16:32:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398298#M2432</guid>
      <dc:creator>ScottOppmann</dc:creator>
      <dc:date>2013-07-01T16:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Public Notification - Avery Label 5160 Aligning Issues</title>
      <link>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398299#M2433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks everyone for following up on this.&amp;nbsp; I was also able to fix this by changing some of the alignment as stated above.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 17:05:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398299#M2433</guid>
      <dc:creator>JeremyWilliams</dc:creator>
      <dc:date>2013-07-31T17:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Public Notification - Avery Label 5160 Aligning Issues</title>
      <link>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398300#M2434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;BTW, The staff loves this new application.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2013 17:07:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398300#M2434</guid>
      <dc:creator>JeremyWilliams</dc:creator>
      <dc:date>2013-07-31T17:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Public Notification - Avery Label 5160 Aligning Issues</title>
      <link>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398301#M2435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jeremy, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Glad to hear you got the Public Notification app working in your organization and for the feedback.&amp;nbsp; Keep the feedback coming.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Scott&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 11:03:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/state-local-government-questions/public-notification-avery-label-5160-aligning/m-p/398301#M2435</guid>
      <dc:creator>ScottOppmann</dc:creator>
      <dc:date>2013-08-01T11:03:00Z</dc:date>
    </item>
  </channel>
</rss>

