Alpha Video Training
Results 1 to 15 of 15

Thread: Barcode Printing

  1. #1
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Barcode Printing

    I originally posted this in the v7 forum, but as i am now using v8, here it is.

    Quote Originally Posted by Lenny Forziati View Post
    A PDF would be generated on the server and use the server's fonts. You can therefore generate your PDF containing the barcode as long as the server has the correct barcode font. This will work whether or not the client (browser) has the correct barcode font.

    The other approach is to in fact convert your barcode to an image as you mentioned. This would be the solution if you want to display the barcode outside of a report. But as it sounds like you've realized, this technique is more involved.
    I have published my files to the webserver, which does have the barcode font installed. But when using a different machine without the barcode font installed, the barcode returns to a basic font.

    Lenny, are there specific steps i need to take to get this to work?

    Denis

  2. #2
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Re: Barcode Printing

    Don't know if you resolved this, but I ran into the same thing today. I don't see a way to solve this in xbasic, which is what I need, but here is a way to solve it in the printer dialog.

    When the print preview displays, click the toolbar button to print as a pdf. Click the link to set pdf options, and there check the box to embed fonts. That will get the barcode font into the document. In my case the pdf file size increased from 18K to 38K - not too bad.

    The setting can be set as a default.

    I still need to do all this from report.saveas(). I don't see a way to do that yet.

    There was another thread that mentioned report.archive(), but that did not embed the fonts.

    Bill.

  3. #3
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,642

    Default Re: Barcode Printing

    Did Alpha ever answer this?

  4. #4
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,642

    Default Re: Barcode Printing

    had another look at the problem - wait for it you set the printer to A5 Default while in the report writer. HELP FILE WOULD HAVE BEEN HANDY.

  5. #5
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Barcode Printing

    Hi Pete,

    No Alpha never did resolve this.

    Have you resolved the problem?

    Denis

  6. #6
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,642

    Default Re: Barcode Printing

    Almost - I'm on to something. Works if on the Intranet not from home - will keep at it.

  7. #7
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,642

    Default Re: Barcode Printing

    This is really strange, if the server is doing the work, then why won't it work from off-site, then if I install the font in Windows, still won't show, then opent Alpha 5, set the remote pc to Alpha 5 Default Printer, go back to the Web, run the app - and the barcode appears in the PDF - it looks like the PDF generator is looking locally.

  8. #8
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,642

    Default Re: Barcode Printing

    Denis, this will put a smile on your face, Selwyn helped me.
    You should be embedding the font when you create the PDF.

    here is code that shows how to set the option to embed fonts into the PDF file.


    Code:
    delete PrintOptions
    DIM PrintOptions as P
    With PrintOptions
             .Concatenate = .f.
             .HasWatermark = .t.
             .MultilingualSupport = .f.
             .EmbedFonts = .t.
             .LinearizeForWeb = .f.
             .Colors2GrayScale = .f.
             .ConvertHyperlinks = .f.
             .WatermarkType = "Text"
             .WatermarkText = "i G r o u p"
             .WatermarkFontName = "Times New Roman"
             .WatermarkFontSize = 200
             .WatermarkRotation = 450
             .WatermarkColorHex = "E8FED2"
             .WatermarkHorizPos = 120
             .WatermarkVertPos = +40
             .WatermarkOnTop = .f.
             .WatermarkPDF = ""
            .Encrypt = .f.
             .OwnerPassword = ""
             .UserPassword = ""
            .CanPrint = .t.
             .CanModifyDocument = .t.
            .CanCopy = .t.
             .CanAddNotes = .t.
             .Use128BitKey = .f.
             .JpegQuality = "Low"
    
    End with
    'query.filter = ""
    'query.order = ""
    
    
    
    
    Dim filename as c 
    filename = session.session_folder + "tempreport.pdf"
    filename = report.saveas("JobBagBasicA4-4@[PathAlias.ADB_Path]\jobregister.ddd","pdf",filter,order,filename,.f.,PrintOptions)
    if file.exists(filename) 
    	currentform.RedirectTarget = session.session_url + "tempreport.pdf?" +  time("hms3")
    end if 	
    skipreport:

  9. #9
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Barcode Printing

    Pete,

    Thats looks fantastic. I will try this out this weekend.

    Denis

  10. #10
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Barcode Printing

    Pete,

    I couldn't wait, i i just tried it out.

    I have two test PC's.

    PC1 - Has the barcode font installed. Logged on the the web app and it worked fine.

    PC2 - Does not have the barcode font installed. Accessed the web app and i got an error message...

    CANNOT EXTRACT THE EMBEDDED FONT 'WTZGWC - IDAutomationHC39M'. SOME CHARACTERS MAY NOT DISPLAY OR PRINT CORRECTLY.

    The Watermark appeard on the report, but the barcode displayed as dots on the screen.

    Do you have to have the font installed locally for it to work on the web?

    Denis

  11. #11
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,642

    Default Re: Barcode Printing

    I think thats a copyright issue, use a different font supplier - or alternate barcode. it will work.

  12. #12
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,642

    Default Re: Barcode Printing

    THERE ARE A FEW TRAPS.

    I got my barcode (Free) from http://www.squaregear.net/fonts/ it works fine.

    Don't just add * for code39 use:
    Code:
    barcode = chr(42)+ALLTRIM(job_number)+chr(42)
    then check the field properties under under format in the report writer. Ensure it is long enough to display the barcode, it defaults to a smaller number change it to say 14 characters.

    Good luck

    Peter

  13. #13
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Barcode Printing

    Hi Pete,

    Where do i put

    barcode = chr(42)+ALLTRIM(job_number)+chr(42)

    Thanks

    Denis

  14. #14
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,642

    Default Re: Barcode Printing

    Make a calculated field (called barcode) on the report, and place it where you want the barcode to appear. Remember to check the length properties.

  15. #15
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Barcode Printing

    OK. Thanks Pete. I will give that a try.

    Denis

Similar Threads

  1. barcode printing
    By rhale@haleabc.com in forum Alpha Five Version 7
    Replies: 17
    Last Post: 11-16-2006, 12:06 AM
  2. Barcode Printing
    By den1s in forum Web Application Server v7
    Replies: 8
    Last Post: 06-28-2006, 03:32 PM
  3. Barcode Printing in A4V6
    By brian in forum Alpha Four Version 6 and Prior
    Replies: 9
    Last Post: 06-20-2003, 01:43 PM
  4. Barcode printing & reading
    By Joe Slinkman in forum Alpha Four Version 6 and Prior
    Replies: 3
    Last Post: 02-09-2001, 05:53 PM
  5. BARCODE PRINTING
    By Nip Lewis in forum Alpha Five Version 4
    Replies: 7
    Last Post: 09-06-2000, 11:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •