Here's what I have:
ITM COMPONENT NUMBER QUANTITY UNITS SC COMPONENT NAME COMPONENT
QUALIFIER AUTH NO. DRAWING NUMBER ST MATERIAL
____ _________________ __________ _____ ___ _______________ ___________________
____________ ________________ __ ___________
10 PWS0002 5.0000 ea M
BOLT, HEX HD 1/2-13 X 4-1/2 LG
PWS0002 C
20 PWS0003 50.0000 ea M
PART3 TESTING NEW PQ
PWS0003 C
30 PWS0004 98.0000 ea M
PART4 BLAH BLAH BLAH
PWS0004 C
40 PWS0005 45.0000 ea M
PART5 BUELLER....ANYONE
PWS0005 C
For the chunk, I'm adding for the Drawing Number PWS0002, PWS0003, PWS0004, &
PWS0005. What I expect is these drawing numbers to be the URL. What I'm
getting is the text itself isn't the URL but if I move just to the left of each
drawing number, it is the URL. The URL field continues all the way to the left
continuing all the way to the ITM column.
Here's more of the code that I'm using to add each component line:
int k=0;
for(int i=0;(i<childBean.size() && k<recPerPage);)
{ // begin for, processing the components
k++;
PartStructureBean child=(PartStructureBean) childBean.get(i);
String strQuantity=appendZerosToQty (child.getQuantity());
int iindex=0;
iindex=strQuantity.indexOf (".");
if(iindex==0)
{
strQuantity="0"+strQuantity;
}
String
strItem=child.getlinenumber().trim().length()>0?child.getlinenumber().trim():(child.getFindNumber()==null?"":child.getFindNumber());
String strCompNum= child.getNumber()== null ? " ":child.getNumber ();
String strUnits = child.getUnit() == null ? " ":child.getUnit ();
String strSC = child.getSourceCode()== null ? " ":child.getSourceCode();
String strName = child.getName()== null ? " ":child.getName ();
String strQualifier = child.getpartQualifier()== null ? "
":child.getpartQualifier ();
String strCompAuthNo=child.getAuthNo()== null ? " ":child.getAuthNo ();
String strDrawNo= child.getDrawing()== null ? " ":(child.getDrawing ());
String strST = child.getDrwRev()== null ? " ":child.getDrwRev ();
String strMaterial = "";
Phrase phrase = new Phrase();
phrase.setFont(f3);
Paragraph prData = new Paragraph();
URL drwURL = new URL(UrlToLatestReleasedDrawingQuery + strDrawNo);
phrase.add(padStr(strItem, 3, true) +
padStr((strCompNum.length()>19?strCompNum.substring(0,
19):strCompNum).toString(), 20, false)
+ padStr(strQuantity, 10, true) +
padStr((strUnits.length()>7?strUnits.substring(0, 7):strUnits), 8, false)
+ padStr(strSC, 4, false) +
padStr((strName.length()>15?(strName.substring(0, 15)).toString():strName), 17,
false)
+
padStr((strQualifier.length()>21?(strQualifier.substring(0,
20)).toString():strQualifier), 21, false) + padStr(strCompAuthNo, 13, false));
prData.add(phrase);
Chunk chunk = new Chunk((strDrawNo.length()>18?(strDrawNo.substring(0,
18)).toString():strDrawNo), f3);
chunk.setAnchor(UrlToLatestReleasedDrawingQuery + strDrawNo);
chunk.setAction(new PdfAction(drwURL));
chunk.setUnderline(1.0f, -1.0f);
prData.add(chunk);
if(strDrawNo.length() < 20)
{ // begin if, drawing number is less than 20, pad it
String padDrw = padStr("",20 - strDrawNo.length(),false);
prData.add(padDrw);
} // end if, drawing number is less than 20, pad it
prData.setFont(f3);
prData.add(padStr(strST,4, false) + padStr(strMaterial, 12, false));
document.add (prData);
childBean.remove(i);
} // end for, processing the components
Regards,
Paul Sweet
Global Methods Group – Engineering Systems
315-433-4540
3 [email protected]
-----Original Message-----
From: 1T3XT BVBA [mailto:[email protected]]
Sent: Saturday, October 27, 2012 3:51 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Adding URL to PDF issue
On 27/10/2012 2:13, Sweet, Paul CCS wrote:
> I’m trying to add a URL to the PDF file and when I do, the URL is
> always to the left of text.
What do you mean by this? What do you expect?
What is the content of prData before adding the Chunk?
What is the alignment of prData?
Are you adding prData using document.add() or are you using another way to add
the paragraph?
Your question is incomplete.
------------------------------------------------------------------------------
WINDOWS 8 is here.
Millions of people. Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
iText-questions mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/ Please check the keywords list
before you ask for examples: http://itextpdf.com/themes/keywords.php
------------------------------------------------------------------------------
WINDOWS 8 is here.
Millions of people. Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php