Platform
Learn
Community
Support
Partner Center
Sign up
or
Log in
logout
Account Settings
Profile
messages
Messages
logout
Logout
Platform
Home
Downloads
IPP
Licensing
Project Sizing
Learn
Training
Documentation
Evaluation Guide
What's New
Community
Home
Forums
Forge
Ideas
Members
Support
Partner Guide
Resources Library
Opportunities
Account Management
Sign up
or
Log in
Home
Forums
Forge
Ideas
Members
Dear ,
What would improve your OutSystems Community experience? Let us know by taking this 2-minute survey.
Pick up the survey
Community
›
Forums
›
Technology & Integration
automatically generating barcodes on pdf's
Community
›
Forums
›
Technology & Integration
automatically generating barcodes on pdf's
New Post
New Post
Tmlewin .
Posted on 2011-09-10
Tmlewin .
Rank: #294
Posted on 2011-09-10
hi everyone ,wow i am really amazed with lots of impressive stuff that has been done so far in this community and i think i have some catching up to do.well, i am currently working on an e -registration portal and i am trying to implement a function ,after a candidate fil the registration form and onclick of the submit buton two things happen submition of info to database(which i ve already done) and secondly it pops the canndidate info in a pop up screen in pdf format and automatically assign/genrate a barcode to the candidate.i have been worlking with the htmltopdf component have managed to do the conversion to pdf but i can automatically generate barcode labels on pdf.i have written a piece of code in visual studio for it /its working but i cant get it to work on the agile platform.here is a code snippet :
string sWorkPath = "";
sWorkPath = this.Context.Server.MapPath("");
// Get the Requested code to be created.
string Code = Request["code"].ToString();
// Multiply the lenght of the code by 40 (just to have enough width)
int w = Code.Length * 40;
// int w = Code.Length * 25;
// Create a bitmap object of the width that we calculated and height of 100
Bitmap oBitmap = new Bitmap(w, 100);
// then create a Graphic object for the bitmap we just created.
Graphics oGraphics = Graphics.FromImage(oBitmap);
// Now create a Font object for the Barcode Font
// (in this case the IDAutomationHC39M) of 18 point size
//Font oFont = new Font("IDAutomationHC39M_FREE.otf", 18);
PrivateFontCollection fnts = new PrivateFontCollection();
fnts.AddFontFile(sWorkPath + @"\IDAutomationHC39M.ttf");
FontFamily fntfam = new FontFamily("IDAutomationHC39M", fnts);
Font oFont = new Font(fntfam, 18);
//Font oFont = new Font(fntfam, 16);
// Let's create the Point and Brushes for the barcode
PointF oPoint = new PointF(2f, 2f);
SolidBrush oBrushWrite = new SolidBrush(Color.Black);
SolidBrush oBrush = new SolidBrush(Color.White);
// Now lets create the actual barcode image
// with a rectangle filled with white color
oGraphics.FillRectangle(oBrush, 0, 0, w , 100);
// We have to put prefix and sufix of an asterisk (*),
// in order to be a valid barcode
oGraphics.DrawString("*" + Code + "*", oFont, oBrushWrite, oPoint);
// Then we send the Graphics with the actual barcode
Response.ContentType = "image/jpeg";
oBitmap.Save(Response.OutputStream, ImageFormat.Jpeg);
any help will be appreciated
André Pereira
Posted on 2011-09-12
André Pereira
Rank: #95
Posted on 2011-09-12
Solution
Hello Tmlewin,
Why don´t you use the ITextSharp to generate the PDF with the barcode. This library is free and has many barcode generator types.
Link with an example of creating a PDF with multiple Barcodes.
http://blog.rubypdf.com/itextsharp/tutorial01/ap09Chap0907.cs.html
Best Regards,
André Pereira
Solution
Joop Stringer
Posted on 2011-09-12
Joop Stringer
Rank: #105
Posted on 2011-09-12
Solution
Have you visited Googles dynamic QR-tag generator tools
http://code.google.com/intl/nl-NL/apis/chart/infographics/docs/qr_codes.html
(This generatesQR Tag images)
I've used this in an MS-Word mailmerge document but can also be used in webpages or any other way
or
ZXing generator
http://zxing.appspot.com/generator/
Solution
Tmlewin .
Posted on 2011-09-21
Tmlewin .
Rank: #294
Posted on 2011-09-21
Solution
thank you all for your help.have just downloaded(have been kind of busy,sorry 4 the late reply)itext.will keep you guys posted on how it goes
Solution
Quick Reply
attachment
Choose File
No file chosen
Submit
Login to reply
New Post
Available Forums
Technology & Integration
News and Announcements
Forge Discussions
Meta
Community Quick Guides
Usability
Installation Troubleshooting
Personal Environment Troubleshooting
Forum Notifications
Email Digest Settings
Loading...