
    Q?h.              
          S SK r S SKrS SKJr  S SK7  S SK7  S SK7  S SK7  S SK	7  S SK
Jr  S SKJr  S SKJrJr  S SKJrJrJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJrJr  S SK J!r!J"r"J#r#  S SK$J%r%J&r&J'r'  S r(S+S jr)\*S:X  a^  \(" 5         \)" 5         S r+\+" S\'" SSS95        \+" S\'" SSSS95        \+" S\'" SSSS S!95        \+" S"\'" S#S$S%S&S'95        \+" S(\'" S)S*SS95        gg),    N)Version)*)USPS_4State)QrCodeWidget)DataMatrixWidget	pylibdmtx)SpacerSimpleDocTemplate	PageBreak)inch)colors)getSampleStyleSheet)	Paragraph)XBoxKeepTogether)DrawingRectLine)getCodeNamescreateBarcodeDrawingcreateBarcodeImageInMemoryc                     [        5       n U S   nU S   n/ nUR                  nU" [        SU5      5        U" [        S[        S-  SS95        U" [        S[        S-  S	S95        U" [        S
[        S-  SS95        U" [        S[        S-  S	SS95        U" [        SU5      5        U" [        S5      5        U" [        SU5      5        U" [        S[        S-  S95        U" [        SU5      5        U" [        S5      5        U" [        SU5      5        U" [        S5      5        U" [        SU5      5        U" [        S5      5        U" [        SU5      5        U" [        S5      5        U" [        SU5      5        U" [        S5      5        U" [        SU5      5        U" [        S5      5        U" [        SU5      5        U" [        S5      5        U" [        SU5      5        U" [        S 5      5        U" [        S!U5      5        U" [        S"5      5        U" [        S#U5      5        U" [!        S$S%5      5        SS&KJn  U" [        S'U5      5        U" U" S'S(S)95        U" [        S*U5      5        U" U" S'S(S+S,95        U" [        S-U5      5        U" U" S-S.S)95        U" ['        5       5        U" [        S/U5      5        U" U" S0S1SS295        U" [        S3U5      5        U" U" S0S1SS+S495        U" [        S5U5      5        U" U" S0S1S+S295        U" [        S6U5      5        U" U" S7S8S)95        U" [        S9U5      5        U" U" S7S8S:S295        U" [        S;U5      5        U" U" S7S8S:S+S495        U" [        S<U5      5        U" U" S<S=S)95        U" [        S>U5      5        U" U" S>S$S%S?95        U" [        S@U5      5        U" U" S@S$S)95        U" [        S@U5      5        U" U" S@S$SASBSC95        S]SF jnU" [        SGU5      5        [)        SHSH5      nUR+                  [-        SSSHSHS	[.        R0                  S SI95        UR+                  [3        S$S)95        U" U5        U" [        SJU5      5        [)        SHSH5      nUR+                  [-        SSSHSHS	[.        R0                  S SI95        U" USKSK5        UR+                  [3        S$SKSKSC95        U" U5        U" [        SLU5      5        U" [5        SM[        -  S	[        -  SN5      5        U" [        SLU5      5        U" [5        SO[        -  SE[        -  SP5      5        [6        (       Gaw  U" ['        5       5        U" [        SQU5      5        [)        SHSH5      nUR+                  [-        SSSHSHS	[.        R0                  S SI95        U" USKSK5        UR+                  [9        SRSKSKSC95        U" U5        U" [        SQU5      5        [)        SHSH5      nUR+                  [-        SSSHSHS	[.        R0                  S SI95        U" USKSK5        UR+                  [9        SRSKSKSDSSST95        U" U5        U" [        SUU5      5        [)        SHSH5      nUR+                  [-        SSSHSHS	[.        R0                  S SI95        U" USVSV5        UR+                  [9        SRSVSVSWSXSYSZ95        U" U5        [;        S[5      R=                  U5        [?        S\5        g )^NNormalHeading1I2of505400141288766g{Gz?r   )barWidthchecksum0001234567890   00012345678905T)r   r   	bearerBoxMSIi  CodabarA012345B)r   zCode 1101234545634563zCode 39z
A012345B%RzExtended Code 39z	A012345B}Code93zCODE 93zExtended Code93zL@@K! Code 93 :-)zCode 128zAB-12345678zCode 128 AutozUSPS FIMAzUSPS POSTNETz
78247-1043zUSPS 4 State0123456709498765432101234567891)r   EAN13123456789012valuezEAN13 quiet=FalseF)r.   quietEAN81234567zEAN5 price=TrueEAN511299)r.   pricezEAN5 price=True quiet=False)r.   r4   r/   zEAN5 price=Falsez
ISBN aloneISBN9781565924796zISBN  with ean5 price01299z"ISBN  with ean5 price, quiet=FalseUPCA03600029145r   )r.   routingQR   2   )r.   xyblack      ?c                     US-  nUS-  nU R                  [        X-
  X!U-   US[        R                  S95        U R                  [        XU-
  XU-   S[        R                  S95        g )NrA   )strokeWidthstrokeColor)addr   r   blue)dr>   r?   whrD   rC   s          Q/var/www/html/env/lib/python3.13/site-packages/reportlab/graphics/barcode/test.pyaddCrossrun.<locals>.addCrossx   sZ    	S	S	d13q1Q36;;GH	d1c1ccfkkJK    zQR in drawing at (0,0)d   )rC   rD   	fillColorzQR in drawing at (10,10)
   z
Label Sizeg      @z1x2-5/8"g      ?z
1/2x1-3/4"z DataMatrix in drawing at (10,10)
1234567890lime)r.   r>   r?   colorbgColorz*DataMatrix in drawing at (90,90) anchor=neZ   darkblueyellowne)r.   r>   r?   rS   rT   anchorzout.pdfzsaved out.pdf)   rZ   r@   rA   ) r   appendr   r   r   r#   r$   Code11
Standard39
Extended39
Standard93
Extended93Code128Code128AutoFIMPOSTNETr   reportlab.graphics.barcoder   r   r   rE   r   r   redr   r   r   r   r
   buildprint)stylesstyleNstyleHstorystoryAddr   rK   rG   s           rJ   runrn      s4    "FHFJFE||H Yw'(U#T	AFGU?tDy1EFU#T	AFGU?tDy1RVWX Yuf%&SYYy&)*WZDI67Yy&)*V$%&Yy&)*Z%&Y)623Z$%Yx()Z	"#Y(&12Z+,-Yz6*+W]#$Y/0['(Yz6*+SXY~v./W\"#Y~v./[/>??Yw'(!'@AY*F34!'uMNYvv&'!&	:;Y[Y(&12!&tDEY4f=>!&t5QRY)623!&uEFY|V,-!&@AY.78!&gNOY;VDE!&gTYZ[Yvv&'!&>?Y}f-.!-7MVcdeYtV$%!$.DEFYtV$%!$.DrBOPL
 Y/89CAEE$q3sqVZZ$
OPEE,3
45QKY16:;CAEE$q3sqVZZ$
OPQr"EE,3b2
>?QKY|V,-T=$&D*=>Y|V,-T4+rDy,78y=vFGC	d1Qs31dST2b	\B<==vFGC	d1Qs31dST2b	\B'RXYZGPQC	d1Qs31dST2b	\B*U]fjkl i &&u-	/rM   c           	      	   / n[        5       nUS   nUS   nUS   n/ nUR                  [        S[        -  U5      5        UR                  [        S[        R
                  " [        R                  " 5       5      -  U5      5        UR                  [        SU5      5        UR                  [        SU5      5        UR                  [        SU5      5        UR                  [        S	U5      5        UR                  [        S
U5      5        UR                  [        SU5      5        UR                  [        SU5      5        UR                  [        SU5      5        UR                  [        SU5      5        UR                  [        SU5      5        UR                  [        SU5      5        [        5       nSSKJn  [        R                   Vs/ s H(  oR                  S5      (       d  M  [        USS 5      PM*     n	n[        R                   Vs/ s H(  oR                  S5      (       d  M  [        USS 5      PM*     n
n[        R                   Vs/ s H(  oR                  S5      (       d  M  [        USS 5      PM*     nn0 nU	(       a  U	S   US'   U
(       a  U
S   US'   U(       a  US   US'   [        R                   Vs/ s H.  oR                  S5      (       d  M  USS R                  S5      PM0     nn[        [!        [        U=(       a    U" U5      =(       d    S/5      5      n[        [!        [        U=(       a    U" U5      =(       d    S/5      5      nU GH   nUR                  [#        5       5        UR                  [        S U-  U5      5        UR                  [%        S!S"5      5        U H  n[        S#U-   U5      /nS$ H_  nUR                  [%        S!S"5      5        ['        U4S%U0UD6nUUl        UR                  U5        UR                  [%        S!S"5      5        Ma     UR                  [        S&WR*                  R,                  -   U5      5        UR                  [/        U5      5        M     GM#     [1        U 5      R3                  U5        [5        S'U 5        gs  snf s  snf s  snf s  snf )(z<Creates large-ish test document with a variety of parametersr   r   Heading2z-ReportLab %s Barcode Test Suite - full outputzGenerated at %szAbout this documentzHistory and Statuszf
        This is the test suite and docoumentation for the ReportLab open source barcode API.
        a  
        Several years ago Ty Sarna contributed a barcode module to the ReportLab community.
        Several of the codes were used by him in hiw work and to the best of our knowledge
        this was correct.  These were written as flowable objects and were available in PDFs,
        but not in our graphics framework.  However, we had no knowledge of barcodes ourselves
        and did not advertise or extend the package.
        aq  
        We "wrapped" the barcodes to be usable within our graphics framework; they are now available
        as Drawing objects which can be rendered to EPS files or bitmaps.  For the last 2 years this
        has been available in our Diagra and Report Markup Language products.  However, we did not
        charge separately and use was on an "as is" basis.
        a  
        A major licensee of our technology has kindly agreed to part-fund proper productisation
        of this code on an open source basis in Q1 2006.  This has involved addition of EAN codes
        as well as a proper testing program.  Henceforth we intend to publicise the code more widely,
        gather feedback, accept contributions of code and treat it as "supported".  
        a  
        This involved making available both downloads and testing resources.  This PDF document
        is the output of the current test suite.  It contains codes you can scan (if you use a nice sharp
        laser printer!), and will be extended over coming weeks to include usage examples and notes on
        each barcode and how widely tested they are.  This is being done through documentation strings in
        the barcode objects themselves so should always be up to date.
        zUsage examplesz!
        To be completed
        z	The codesaV  
        Below we show a scannable code from each barcode, with and without human-readable text.
        These are magnified about 2x from the natural size done by the original author to aid
        inspection.  This will be expanded to include several test cases per code, and to add
        explanations of checksums.  Be aware that (a) if you enter numeric codes which are too
        short they may be prefixed for you (e.g. "123" for an 8-digit code becomes "00000123"),
        and that the scanned results and readable text will generally include extra checksums
        at the end.
        r   )flattenz--width=   Nz	--height=	   z--isoscale=   widthheightisoScalez--scale=,r    zScale = %.1f$      zCode: )r   r    humanReadablezBarcode should say: created)r   r[   r   __RL_Version__timectimer   reportlab.lib.utilsrq   sysargv
startswithfloatintsplitlistmapr   r	   r   renderScale_bcr.   r   r
   rg   rh   )fileNamerl   ri   rj   rk   styleH2	codeNamesrq   r>   ru   rv   rw   optionsscalesscalecodeNameshrdrs                      rJ   fullTestr      s    E "FHFJFZ GE	LLJ^[\bcd	LL,tzz$))+/FFOP	LL0':;	LL/9:	LL   
LL    
LL 
   
LL 
   
LL    
LL+W56	LL   
LL;01	LL    I+#&88H8a||J/G\U1QR5\8EH$'HHJHq[0IleAabElHFJ%(XXMXm1LAbcFXHMGqgg6!9wx x{$(+M1LL4Laekk#FM#eF6wv=1#>?F#eF6wv=1#>?FY[!Y~e3W=>VB^$!H8h.89AB()(O"OwO!&B(  HHY5DfMNLLa) "	  h%%e,	)X5 IJM
 Ns0   R1-R1R60R6R;3R;S %S __main__c                 ^    [        U S5      nUR                  U5        UR                  5         g )Nwb)openwriteclose)namememoryfs      rJ   createSampler     s!    dO			rM   ztest_cbcim.pngr+   r,   r-   ztest_cbcim.gifr0   r1   gif)r.   formatztest_cbcim.pdfr8   r9   pdf(   )r.   r   	barHeightztest_cbcim.tiffr   r)   r*   tiff)r.   r:   r   ztest_cbcim-1.pdfr;   zBThis is the end my only friend the end at the end of the Universe.)ztest_full.pdf),r   r~   	reportlabr   r}   !reportlab.graphics.barcode.common!reportlab.graphics.barcode.code39!reportlab.graphics.barcode.code93"reportlab.graphics.barcode.code128reportlab.graphics.barcode.usps!reportlab.graphics.barcode.usps4sr   reportlab.graphics.barcode.qrr   reportlab.graphics.barcode.dmtxr   r   reportlab.platypusr	   r
   r   reportlab.lib.unitsr   reportlab.libr   reportlab.lib.stylesr   reportlab.platypus.paragraphr   reportlab.platypus.flowablesr   r   reportlab.graphics.shapesr   r   r   re   r   r   r   rn   r   __name__r    rM   rJ   <module>r      s     / / / / 0 - 9 6 G C C $   4 2 ; 9 9 e eN`_B ZEJ !"<WN"[\!"<V9]b"cd!"<V=`eqs"tu"#=mSir  HN  $O  P#$>t6z  CH%I J rM   