on 02-09-2009 1:41 AM
I want to create a barcode on pdf and i use jasper file to create the pdf ,
There is parts of my code :
String getUrl=this.getClass().getResource("PartsPDFBarcodeLable.jrxml").getFile();
byte[] bytPDF = new byte[0];
if (FL.exists())// template file exist
{
bytPDF = getPDFBytes(getUrl, arrayData);
throw new RuntimeException("FL.exist = true and url = " + getUrl);
}
return bytPDF;
getUrl result is file:/D:/usr/sap/J2E/JC00/j2ee/cluster/server0/bin/ext/tsmc.compartsvendorservlibj2elib/tsmc.compartsvendorbeanjava~barcodeAssembly.jar!/com/tsmc/parts/nw/component/utils/PartsPDFBarcodeLable.jrxml
the problem is FL.exist() always return false
how can i solve the problem??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for your answer.
i found the problem is that the path is too long so i move the file on to other directory and its worked
thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this code
String resourcePath;
String path;
String str6=str10+str11+str7+str8+str9+".txt";//file name
File file=new File(str6);
resourcePath =
WDURLGenerator.getResourcePath(
wdComponentAPI.getDeployableObjectPart(),
str6);
path = file.getAbsolutePath();resourcePath =
WDURLGenerator.getResourcePath(
wdComponentAPI.getDeployableObjectPart(),
str6);
path = file.getAbsolutePath();
wdComponentAPI.getMessageManager().reportSuccess("File path"+path);
This code to print the path of the file on screen when u run application.
Regards,
H.V.Swathi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.