Error when i generate barcode in itextpdf - itext

i have this probleam , where i´m work they buy a generate barcode, idautomation is the software
they ubicate in a server the direction is:
Cbarra = Image.getInstance("http://200.36.25.89/CodeBarNew/LinearServlet?BARCODE="+strCadenaCodBarra+"&PT=T&ST=Y&BAR_HEIGHT=1&EM=.06")
strcadenacodbarra= Ê415770999800426980200000709388Ê39000010454400Ê9620161014
but the codebar work in my local machine. But when i put in server the code bar throw error.
this is the code for put in the pdf
Cbarra.scaleAbsolute(305, 75);
cellCobBarrasImg = new PdfPCell(Cbarra);
cellCobBarrasImg.setPadding(0);
cellCobBarrasImg.setMinimumHeight(90);
thx for help.

Related

Generate more space between barcodes using iText 5.4.1

im using itext 5.4 to generate some 128 type barcode, but i am strugling to find any way to generate the barcode bar with more space between them. could anyone help? I tried lots of itext options, but none of them worked.
Here is a snippet of the code:
Barcode barcode = new Barcode128();
barcode.setBarHeight(50);
barcode.setCode(text);
Image img = barcode.createAwtImage(Color.BLACK, Color.WHITE);
BufferedImage bi = new BufferedImage(img.getWidth(null),
img.getHeight(null), BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = bi.createGraphics();
g2d.drawImage(img, 0, 0, null);
I would imagine setX() is what you're looking for.
I tried that, but it didn't work, what I had to do was call the method img.getScaledDefinition, or somethind like that, passing in the new width of the image.

Xuggler write and read video via H.264 to/from Sockets

I want to be able to send BufferedImages generated from my java program over the local network in real time, some my second application can show them.
I have been looking through a lot of websites over the last 2 days but I wasn't able to find anything. Only thing I found was this:
Can I use Xuggler to encode video/audio to a byte array?
I tried implementing the URLHandler but problem is, MediaWriter still wants an URL and as soon as I add a VideoStream, it opens the container a second time with the url and then in crashes.
I hope you can help me and thanks in advance.
Code I have right now:
val clientSocket = serverSocket.accept()
connectedClients.add(clientSocket)
val container = IContainer.make()
val writer = ToolFactory.makeWriter("localhost", container)
container.open(VTURLProtocolHandler(clientSocket.getOutputStream()), IContainer.Type.WRITE, IContainerFormat.make())
writer.addVideoStream(0, 0, ICodec.ID.CODEC_ID_H264, width, height)

Epos2Printer SDK: Swift

I have been trying for a while now and cannot seem to connect to my Epson TM-T88V printer from my app built with Swift. I have tried what I learned here https://github.com/Shoptree/epsonPrintSDK/issues/3 and was able to make a connection, but it is a dated SDK and I need more printers to be compatible. I have also looked at the Epson pdf guide written in Obj-C and the Java version.
I have tried many variations of the following. (Note: I have no problem bridging the headers and getting access to the library.
var printer = Epos2Printer(printerSeries: 0, lang: 1)
printer.connect("TCP:192.168.X.X", timeout: 10000)
printer.beginTransaction()
printer.addText("Hello World")
printer.addCut(1)
Thanks in advance!
I am not sure if you still have this problem, but according to your code I can suggest couple of fixes:
Put correct printer series.
Add couple of feed lines. Some Epson printers don't print if there is no enough lines to print (6-8 lines enough).
Call beginTransaction after adding text and cut.
Call sendData and endTransaction at the end.
Here is updated code:
var printer = Epos2Printer(printerSeries: EPOS2_TM_T88.rawValue, lang: EPOS2_MODEL_ANK.rawValue)
printer.connect("TCP:192.168.X.X", timeout: 10000)
printer.addFeedLine(5)
printer.addText("Hello World")
printer.addFeedLine(5)
printer.addCut(EPOS2_CUT_FEED.rawValue)
printer.beginTransaction()
printer.sendData(Int(EPOS2_PARAM_DEFAULT))
printer.endTransaction()

Camera::connect() brings AppOps Bad Call: on Android 4.4?

I wrote an apk to test camera on Android 4.2.2 before. This apk works fine.
However, when I moved this apk to Android 4.4.
I got a problem with Camera::connect().
Fail to call Camera::connect() and it prints message:
W/AppOps ( 1546): Bad call: specified package TestCamera under uid 1000 but it is really -1
I think the reason may be USE_CALLING_UID, security or something that I can't figure out.
Please give me some suggestions, thanks!
My apk is very simple, only one activity. In onCreate(), I called a jni function.
The jni function just do the code belowed:
int cameraId = 0;
String16 clientPackageName("TestToGoService");
sp<Camera> camera = Camera::connect(cameraId, clientPackageName, Camera::USE_CALLING_UID);
if (camera == NULL) {
ALOGE("camera==NULL.");
return -1;
}
ALOGV("camera=%p.",camera.get());
Try:
If I put the code above to a executable (main()), then Camera::connect() works OK.
I have already add permissons on AndroidManifest.xml
Thanks again!
I'm not sure if it's still of any help. I had the same error in the past. The problem is clientPackageName, that has to be set to the exact package name of your application (which must have the proper camera permissions set on the manifest).

How do I detect if XenApp Client is installed on user machine?

We are upgrading from Citrix Metaframe to XenApp, and I need to know if there's a way to programmatically detect if the XenApp Web Plugin v11.0 is already installed on a client machine when it contacts our webserver for login -- this was previously done for the Metaframe Web Client by attempting to instantiate the ICA client in an ASP script, which used the results to determine whether to offer the client as a download/install.
The current code for this detection is:
Set icaObj = CreateObject("Citrix.ICAClient")
The above code does not find the XenApp plugin.
I continued my research after posting this question and I finally found the answer. Only 3 views on this question since I posted it, but despite the disinterest I believe I should answer my question, "Just in Case" someone else has this problem.
I was mistaken in my statement in question that the code I posted didn't find the XenApp plugin. In fact, it does. It returns a valid object in the presence of both Metaframe and XenAppWeb. I posted this question on Citrix's own forums, and no answers there either.
What I did to find the answer was to create a VS2008 project to which I added a COM reference to the Citrix ICA library -- both of them, installed separately one at a time. I found that both had a COM library named WFICALib, and searched through both of them to see if there was something that might distinguish them. What I found was a property, ClientVersion, which was 9.0.xxx for Metaframe, and 11.0.xxxx for XenAppWeb.
BINGO!
From this I cut the following code to return the version as a function in VBScript:
Function GetVer()
Dim icaObj, Ver
On Error Resume Next
Set icaObj = CreateObject("Citrix.ICAClient")
if err.number = 0 then
if IsObject(icaObj) then
GetVer = icaObj.ClientVersion
else
GetVer = 0
end if
set icaObj = nothing
else
GetVer = 0
end if
End Function
ADDENDUM:
Since posting this answer, I have discovered that this script in the newer versions of Internet Explorer (e.g. IE9) is not reliably detecting the plugin -- sometimes it worked, and other times not! What I did to fix the problem was to switch the script to JScript instead of JavaScript, and the new version looks like this:
<script type="text/jscript">
function GetCitrixVersion() {
try {
var icaObj = new ActiveXObject("Citrix.ICAClient");
return icaObj.ClientVersion;
}
catch (e) {
return 0;
}
}
</script>
Note the script type is text/jscript, not text/javascript.