pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hannes Erven <han...@erven.at>
Subject Re: PDFBox and Pattern
Date Mon, 09 Jan 2017 20:19:14 GMT
Hi,


> thanks for reply, but I only have the string the pattern matches.
> In PDF there is a table like this:
> 10110  Paperbox  3,49
> 30220N  Scissors    7,99
>
> My pattern only matches first column.

How exactly are you using the Pattern - are you by any chance just 
looking at the portion that actually matched?

If the entries you are seeing are like this:
  col1
  col2
  col3

  col1
  col2
  col3

... then you could try a loop with state:

while(...){
	if (expectNextLineType==2){
		article = line;
		expextNextLineType=3;
	}else if (expectNextLineType==3){
		price = line;
		// save articleno, article, price
		expectNextLineType==1;

	}else if (pattern1 matches){
		articleno=line;
		expectNextLineType =2;
	}
}


Best regards,

	-hannes

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message