pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thiruppathi M. <thiruppa...@sps.co.in>
Subject RE: overlap issue
Date Sat, 17 Dec 2016 08:59:12 GMT
Hi,

Herewith I have enclosed the PDF input and output as images for your reference.

I have to remove the sentence "00 (2015) 000-000" and insert the new sentence with appropriate
values.

It was updated correctly and I am facing the below issue,

1. The ndash (-) in the page range was getting overlapped with the next character after the
conversion.
Please refer PDF_output.png. eg.3622-3628 


a. [You have a tokens object (what type?)]
	
		This is the tokens object sample code.

				PDDocument doc = PDDocument.load( "input.pdf" );
				List pages = doc.getDocumentCatalog().getAllPages();
				PDPage page = (PDPage)pages.get( 1);
		            	PDStream contents = page.getContents();
		                
		            	PDFStreamParser parser = new PDFStreamParser(contents.getStream());
		            	parser.parse();
		            
		            	List tokens = parser.getTokens();


b. [You have a tokens object (what type?)]
			
		  The code for array, 

				COSArray array = new COSArray();
				String newSentence = "Materials Today: Proceedings "+ volume_number+"("+strYear+ ") "+
First_Page_Number+"-"+Last_Page_Number";
				array.add(new COSString(newSentence));
				tokens.add(stvalue-1, array);

Please advice how to proceed further.

Regards
Thiruppathi M.

-----Original Message-----
From: Tilman Hausherr [mailto:THausherr@t-online.de] 
Sent: 16 December 2016 PM 08:53
To: users@pdfbox.apache.org
Subject: Re: overlap issue

Am 16.12.2016 um 15:18 schrieb Thiruppathi M.:
>
> Hi,
>
> The sentence doesn't appear properly in PDF when delete and insert the 
> new sentence.
>
> This is the code:
>
> String newSentence = "Materials Today: Proceedings "+ volume_number+" 
> ("+strYear+ ") "+ First_Page_Number+"-"+Last_Page_Number";
>
> array.add(new COSString(newSentence));
>
> tokens.add(stvalue-1, array);
>
> Refer the below output,
>

The image didn't get through. And I have no idea what you want to do. 
You have a tokens object (what type?) to which you added a value and an 
array. For what?

Tilman

> 3268 is overlapped on ndash. Please advice how to resolve this issue.
>
> Regards
>
> Thiruppathi M.
>



Mime
View raw message