We are compositing pdf files from xml, using xsl :fo.

For billing reasons, we have to count the produced lines of text/tables.

 

That’s why we need to count lines, from VB if possible.

 

We can also get the quads for all text, but it’s a hard way…

 

 

-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Mark Storer
Envoy� : mercredi 12 novembre 2003 20:27
� : '[EMAIL PROTECTED]'
Objet : RE: [PDFdev] line counter

 

That's quite an up-hill battle you've got there.

 

First of all, you need to gain access to the (compressed) stream data for each page.  You then need to search through all the drawing operations on each page looking for all the different drawing commands (line-to, rect, curve-to, and probably a couple others I can't think of at the moment), and add them up.

 

You also need to look at the contents for XObject calls, "/do", and count all the line commands in any XObject Forms.  Note that XObject forms can also call other XObjects, so this could be a recursive algorithm.

 

So, hopefully you can find a VB library that will allow you low-level access to a PDF, and then do some serious string parsing.

 

You'll need to read up on the PDF specification.  There you will find all the different drawing commands (they're not "line-to", or "rect", but "l" and "re"... plus any others I didn't recall), where to find XObject resources, and so on.

 

All this would probably easier to do in a plugin, provided you already knew C/C++ reaonably well.

 

What's the goal here, anyway?  Why do you want to know the number of lines in a PDF?

--Mark Storer
  Software Engineer
  Cardiff Software
#include <disclaimer>
typdef std::disclaimer<Cardiff> Discard;

-----Original Message-----
From: Christian Brugeron [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 12, 2003 1:41 AM
To: [EMAIL PROTECTED]
Subject: [PDFdev] line counter

Hello,

 

Is there a simple method to count the lines in a PDF, without creating a plug-in ?

 

Environnement is VB on WinXP.

 

Christian

 

 

Reply via email to