Set Barcode to Code39? - pdfclown

Looking at sample barcode script. I wonder how do I set the barcode to code39 for it to work for vehicle's VIN?
pdfclownEntities::EAN13Barcode barcode = new pdfclownEntities::EAN13Barcode(parmBookValues.Vin);
XObject barcodeXObject = barcode.ToXObject(parmDocument);
primitiveComposer.ShowXObject(
barcodeXObject,
new dotnetDrawing::PointF(boxAdjustedPositionX, boxAdjustedPositionY),
GeomUtils.Scale(barcodeXObject.Size, new dotnetDrawing::SizeF(boxWidthX, boxHeightY)),
XAlignmentEnum.Right,
YAlignmentEnum.Bottom,
0
);

Code39 is not implemented at the moment, sorry

Related

send image behind text word using VBS

i'm using VBS to create a title screen and i have a problem trying to send a image behind te text.
Here is my code:
function page()
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
Set objDoc = oWord.Documents.Open("C:\xxx.docx")
objDoc.Sections.PageSetup.DifferentFirstPageHeaderFooter = true
Set head = objDoc.Shapes.AddPicture("C:\img.png")
head.PictureFormat.Brightness = 0.7
head.ZOrder msoSendBehindText 'I try to use msoSendToBack, SendBack, SendBehindText, Back and others and not work
end function
i just want send "head" to the back , the actual result is the image is not in the back of text, and the version of word is 2013.
If someone, know how to solve this, thanks in advance.
The solution was, the utilization of numeration
head.ZOrder 5
https://bettersolutions.com/vba/enumerations/msozordercmd.htm
with this change, i solve my problem.

iText Image and transparency

I'm trying to add a PNG image to an existing pdf, but the transparency is converted to black color.
PdfReader reader = new PdfReader(pdfPath);
File f = new File(pdfPath);
String result = f.getParent() + File.separator + UUID.randomUUID().toString() + ".pdf";
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(result));
Image image = Image.getInstance(ImageIO.read(new File(imagePath)), null);
PdfImage stream = new PdfImage(image, null, null);
PdfIndirectObject ref = stamper.getWriter().addToBody(stream);
image.setDirectReference(ref.getIndirectReference());
image.setAbsolutePosition(30, 300);
PdfContentByte canvas = stamper.getOverContent(1);
canvas.addImage(image);
stamper.close();
reader.close();
How can I keep transparency?
First this: I am violating the policy at iText Software by answering this question. You are using an old version of iText, and the policy dictates that voluntary support on iText 5 or earlier has stopped. You should either use iText 7, or you should get a support contract if you still want support for an old iText version.
However, I am curious. I want to know where you found this clunky code (or why you decided to write this code):
Image image = Image.getInstance(ImageIO.read(new File(imagePath)), null);
PdfImage stream = new PdfImage(image, null, null);
PdfIndirectObject ref = stamper.getWriter().addToBody(stream);
image.setDirectReference(ref.getIndirectReference());
image.setAbsolutePosition(30, 300);
PdfContentByte canvas = stamper.getOverContent(1);
canvas.addImage(image);
You don't need ImageIO and you don't need to create a PdfImage, nor do you need to add that image to the body of a PDF file. The code you are using is code specialists would use for a very particular purpose. If you know that particular purpose, please explain.
If adding an image at an absolute position is all you want to do (that's a general purpose, not a particular purpose), your code should be as simple as this:
Image image = Image.getInstance(imagePath);
image.setAbsolutePosition(30, 300);
PdfContentByte canvas = stamper.getOverContent(1);
canvas.addImage(image);
In this case, you don't have to worry about the image mask; iText will take care of that for you.
Please also explain why you're using an outdated version of iText instead of iText 7. If you want your application to be future-proof, you should upgrade to iText 7 now (to avoid wasting time later).

TGauge doesn't change value in runtime

At first, please bear with me, as I am quite new to the Delphi world. I am a former C++, C# and embedded developer.
I have Delphi 7 and Delphi RAD Studio 10.2 Starter on Windows 7 64-bit.
I have tried the TGauge component in both versions, as it is standard in Delphi (I think).
So, the issue is when I try to set the Progress property with a value at run-time, it doesn't reflect that on the GUI. But, if I set a value at design-time from the Object Inspector, it reflects the value as it should be, and the Gauge
paints the percentage correctly.
Steps to test this behavior:
Dragged and dropped the TGauge component from the "Samples" palette onto the Form.
I set MaxValue = 100 and MinValue = 0 in the Object Inspector.
I created a textbox (txtValue) on the Form.
I created a button (btnSetValueClick) on the Form and used this code:
procedure TMainForm.btnSetValueClick(Sender: TObject);
begin
Gauge1.Progress := StrToInt(txtValue.Text);
end;
So, I was expecting the Gauge would show the value entered, but it didn't.
When I debug the code, it hits btnSetValueClick() and sets the value inside.
What am I missing here?
EDIT: (This is the code in the form.)
object Gauge1: TGauge
Left = 53
Top = 81
Width = 191
Height = 113
ParentCustomHint = False
Color = clMenu
ForeColor = clRed
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Default'
Font.Style = []
Kind = gkNeedle
ParentColor = False
ParentFont = False
Progress = 35
EDIT:
I have created a new project and started from scratch. I put the TGauge without changing any single properties of it. And it has started to work although I don't still see the difference can cause this behavior. At least this might give a clue this component can go wrong without an obvious reason, especially to beginners like me.
Please consider the case is as closed. Thank you.

How do I create barcode image without containing text at bottom using barbecue library

I want to generate a barcode.png file but the file generated contains the Barcode number also and I don't want that, I only want image without Text.
How to do that?
Below is my code:-
Barcode barcode3;
barcode3 = BarcodeFactory.createCode128("CODE128x1");
barcode3.setResolution(300);
BarcodeImageHandler.savePNG(barcode3, new File("Code128-1.png"));`
The text will not generate in case you pass the null parameter to setFont function of Barcode class. Your code looks like as below
Barcode barcode3;
barcode3 = BarcodeFactory.createCode128("CODE128x1");
barcode3.setFont(null);
barcode3.setResolution(300);
BarcodeImageHandler.savePNG(barcode3, new File("Code128-1.png"));
only adding this to your code :
barcode3.setDrawingText(false);
the method above will remove text from the barcode. full code
Barcode barcode3;
barcode3 = BarcodeFactory.createCode128("CODE128x1");
barcode3.setDrawingText(false);
barcode3.setResolution(300);
BarcodeImageHandler.savePNG(barcode3, new File("Code128-1.png"));

ActionScript 2 loadClip depth

When I use:
loader = new MovieClipLoader();
_root.createEmptyMovieClip("level1",getNextHighestDepth());
_root.level1.createEmptyMovieClip("image",getNextHighestDepth());
loader.loadClip("http://someimage.jpg",_root.level1.image);
...it works and the image shows up.
But when I use:
loader = new MovieClipLoader();
_root.createEmptyMovieClip("level1",getNextHighestDepth());
_root.level1.createEmptyMovieClip("level2",getNextHighestDepth());
_root.level1.level2.createEmptyMovieClip("image",getNextHighestDepth());
loader.loadClip("http://someimage.jpg",_root.level1.level2.image);
...the image doesn't show up. Can anyone tell me why? How can I make this work?
the depth you are supplying is going to be '1'. is that what you are expecting?
each movie clip has it's own set of depths, so the nextHighestDepth() of the newly create 'image' mc, will be 1. it should not prevent loading the image though.
As gthmb says, you should call getNextHighestDepth() on the same MovieClip as you do the createEmptyMovieClip() on. So your code example should be more like:
loader = new MovieClipLoader();
_root.createEmptyMovieClip("level1",_root.getNextHighestDepth());
_root.level1.createEmptyMovieClip("level2",_root.level1.getNextHighestDepth());
_root.level1.level2.createEmptyMovieClip("image",_root.level1.level2.getNextHighestDepth());
loader.loadClip("http://someimage.jpg",_root.level1.level2.image);
Also, I would recommend storing references to the created MovieClips, so you won't have to use the full path in each occurrence in the code, something in the lines of this:
loader = new MovieClipLoader();
var level1:MovieClip = _root.createEmptyMovieClip("level1",_root.getNextHighestDepth());
var level2:MovieClip = level1.createEmptyMovieClip("level2",level1.getNextHighestDepth());
var image:MovieClip = level2.createEmptyMovieClip("image",level2.getNextHighestDepth());
loader.loadClip("http://someimage.jpg",image);

Resources