\Zend\Barcode generates wrong barcodes - zend-framework

using \Zend\Barcode (ZF 2.3.1) I'm not able to produce a readable barcode.
I've attached the picture generated (inside a PDF) by Zend Framework's tool.
The original text was 00000001C and the factory is code39. I've tried with code128 but same problem.
For some reason, my Motorola LS2208 can not recognize this barcode.
The specs of this scanner tells it should !
An other strange thing is all "code 39" or "code 128" generated on http://www.barcoding.com/upc/ are different from the ones produced by ZF.
I'm quite new to barcode generation and I just don't have any clue of what are the possible reason of this to fails. Can someone bring me some light here ?
Is the generated barcode correct, at least ?
The ZF documentation about specific renderers is very light...

OK, I finally found an answer to this.
First, I was generating barcodes with a width of 2cm.
This is really too tiny for 9 characters using the code 39 symbols.
The screenshot I've taken was made zooming on the PDF ; it shows a code where vertical bars were overlapping themselves.
Basically the solution is : NEVER EVER provide a 'factor' value lower than 1 to BarcodeZF::factory(), because this is what have makes bars overlap.

Related

How can I process Persian texts using Rapid Miner?

I am working on a persian classification project. Persian texts is very similar to arabic texts. when I use Tokenize, it does not show any word in its wordlist page and in Example Set Page, The Image below will be shown:
I need to classify persian text to some category, but I dont know How?.
I Follow some steps like this:
1- Read Excel(using Read Excel component) dataset with 2 column => col1:persian Text ,col2: Category
2- I use Set role component to labeling data
3- I use Process Documents from Data component containing :(Tokenize(with any mode not change anythings) and Filter Token(min:5,max:25) inside it)
4- Then I use Cross Validation Component to train with SVM or Basian and in test mode to get performance.
The program runs correctly and performance is not bad for e.g accuracy is 50% but I think my work is Wrong.
Any help would be appreciated.
first, make sure your text data have UTF-8 encoding
and if u use filter tokens(by length) 5 is too much for minimum try 2 or at least 3
also, I recommend using Filter Stopwords (Dictionary) operator and the dictionary should have Persian stopwords in each line
hope it will help u

Is this a bug in Berkley Snap! or am I just missing something?

I've created a "block" in Berkeley Snap! that implements Heron's Formula (calculating the area of a triangle given the length of the three sides). It works but it reports an error. I've included a screen shot below that sums it all up. (FYI, there are three such blocks in the image below named HF2, HF and Herons Formula. I created all three trying to fix the problem.)
The routine correctly calculates the value (~125.14), but it also reports an "inside error" that the "reporter didn't report." But, as you can see in my block editor window, the block does report.
Am I missing something, or is this a bug? (I don't want to report a bug on their github site, if I am missing something.)
BTW, I tagged this "mit-scratch" because there is no tag available for Berkeley Snap!
A discussion of this issue can be found here. Bottom line: delete the last reporter block and then add a new one. That should fix it.

Selection problems after Bio Format Importer, czi and zvi Files, ImageJ

Hello I'm using ImageJ to analyse -czi and -zvi files. I'm using an automatic selection with "create selection" or "analyze particle"s. It's working well when openening/importing the files with ImageJ. But when I try to use the Bio-Format importer Plugin with the same pictures, it's not working. Not my intended ROIS are selected but the background or even nothing. With using the plugin something about the parameters of the picture changes and I don't know what it is or how to undo it. Does somebody has an idea?
One of the Solutions I realised is a Change of scale. My original files use pixels, whereas the BioFormat importer converts the scale into microns.
Analyze--> Set Scale... --> Click to remove scale or changing the scale solves one part of the problem.
For a macro following code restores the scale:
run("Set Scale...", "distance=0 known=0 pixel=1 unit=pixel");
Still somethng about the colour values changes, I can't find, create selection is still not working properly.

Save the annotation marks in flexpaper annotation document viewer

How to save the annotation marks in flexpaper annotation document viewer?
Thanks.
FlexPaper provides a JavaScript function called getMarkList:
marksArray = JSON.stringify($FlexPaper('documentViewer').getMarkList());
You can apply the annotations again using addMarks:
var initialMarks = JSON.parse(marksArray);
$FlexPaper('documentViewer').addMarks(initialMarks);
This works for the HTML5 version but I suspect it would also apply to the Flash and HTML versions.
Ok, so I think I've found a bug in Flexpaper that prevents this from being useful (bug is in the Flash version, have not tested HTML version). If anyone has actually got this to work on Flash, please let me know!
Basically, addMark() is performing an unnecessary coordinate transformation which makes it impossible to put back in a mark that you have extracted in the same spot (this only seems to be the case for notes, drawings don't seem to have this issue).
Here's how to reproduce:
Go to http://devaldi.com/annotations/UK_Investment_Fund.php?ro=flash,html and open Chrome JS console. Enter these commands:
>> note = $FlexPaper('documentViewer').getMarkList()[2]
Object {width: 200, pageIndex: 1, height: 180, note: "The annotations plug-in allows both highlighting a…created↵↵Notes can be resized, moved and deleted.", id: "3AFE17A3-4977-3ECA-C468-70F2C40B81E8"…}
>> // Now try to add back in the same annotation
>> $FlexPaper('documentViewer').addMark(note)
>> // Notice that on the screen the note is in the wrong spot
>> // (not the same spot as the original one). Lets check the positioning
>> added_note = $FlexPaper('documentViewer').getMarkList()[6]
>> added_note.positionX
356.718192627824
>> note.positionX
-5.945303210463702
The normalize/denormalization of positions should work fine as long as you set 'displayFormat' to 'html' as part of your object creation. The normalisation process basically adjusts X/Y/Width/Height so that the document is considered to be 1000 in height. The viewer then adjusts the positions when the annotations are being displayed if the document is different in height for flash or html. It also of course considers the proportions of the width/height of the document as part of this process.
All the best
Erik on the FlexPaper Team

Making a PDF output in raster format instead of vector using itextsharp

I have written C# code to save product specifications to a PDF document using iTextSharp, mainly with PdfPTable and Chunks/Paragraphs in the PdfPCells. However, I have been told that the output is unacceptable due to the fact that you can highlight and copy the text from the document and document storage and retrieval server software that they are currently using does not support "Vector" based PDFs. I'm not exactly certain what the difference is between a raster pdf and and vector pdf. Basically, every page of the PDF Document should be an image so that the text can not be highlighted. Is there any way to do this without using the DirectContent? Below is an image, illustrating a portion of the PDF that was created, and how the text can be selected and copied, which is the incorrect functionality.
I would like to avoid directly writing to the canvas, unless there is a way to do this and still have itextsharp handle my formatting and proper paging.
The windows application PDF2R works well, but doesn't seem to offer any programmatic solutions. I have found libraries that stated that they do this sort of conversion, but are several thousand dollars. I'd like to work within my budget and use the itextsharp or something much cheaper than this.
I would suggest you try to generate an image using the System.Drawing class and then insert that into the PDF document.
Call this code on your PdfWriter object:
writer.SetEncryption(PdfWriter.STRENGTH40BITS, null, null, PdfWriter.AllowPrinting);
This won't prevent users from selecting text, but it will prevent them from copying and pasting it. Give it a try.