Re: [Podofo-users] Margins and Fonts

2009-07-22 Thread Pierre Marchand
Vous (Trevor Kaufman) avez écrit :
> Is there a plan for adding the ability to compute the "bounding box"
> into PoDoFo?

In my opinion it’s really out of PoDoFo’s scope.

-- 
Pierre Marchand

--
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] recent changes

2009-07-22 Thread Pierre Marchand
Vous (Craig Ringer) avez écrit :
> On Tue, 2009-07-21 at 15:51 +0200, Pierre Marchand wrote:
> > Vous (Pierre Marchand) avez écrit :
> > > I’m getting into your recent changes and had a couple of trivial issues
> > > I wan’t to know if I must fix it myself or wait for you finish the
> > > work.
> > >
> > > + podofo_config.h is not installed.
> > > + HAVE_FONTCONFIG is publicly defined in podofo_config.h but not
> > > prefixed with "PODOFO_".
> >
> > Going further I see there are rather more changes than I thought at first
> > sight.
> > It’s still not clear for me if podofo_config.h is intended to be public
> > or just used at build time, I did notice it was missing when building
> > apps relying on podofo that complained PDF_INT*_TYPENAME were not naming
> > types.
>
> Hmm, that's a really good point, in that I've failed to separate what
> should be public and what should be private (podofo compile-time only).
>
> *headdesk*
>
> After all the work I did getting Pdf3rdPtyForwardDecl.h etc set up to
> hide PoDoFo's external header dependencies you'd think I'd not do
> somthing this dumb. Sorry.
>
> I do think moving to the config.h approach will be clearer, I just need
> to split it (and the compiler compat stuff) into public/private parts
> and install the public parts.

yes.

>
> I'll see if I can look at it tomorrow.
>
> > Regarding deprecation of pdf_long as a  ptrdiff_t, the reasons for it are
> > quite clear
>
> I'd _really_ appreciate an explanation, then […]

Hm, I must have been unclear myself. I just wanted to say  that the reasons 
you exposed to deprecate it were rather convincing.

> 
> That said, I was certainly wrong to change it in the sources as I did.
> My only defense is that I was really tired and too thick to notice it.
> I've reverted the alteration of the typedef. I do think pdf_long needs
> to disappear though, and that it's currently used incorrectly where it
> touches on file offsets, xref offsets, etc.

I don’t think it’s so much of a problem, it’s trunk after all. As long as we 
know where we’re heading and can help to speedup things it’s fine. Now working 
on removing it from PdfStream, I’ll post a diff before committing.


One more thing, I used to write things like:
#if defined(pdf_long)
PoDoFo::pdf_long mlen = 0;
#else
long mlen = 0;
#endif
stream->GetCopy(&mbuffer, &mlen);

that allowed me to build code against 0.7.0 distribution as trunk as well 
(pdf_long has been introduced without version increment afaik) and I’m now 
wondering if it wouldn’t be the occasion to denote trunk with such a version 
number you proposed some times back: 0.7.99.





-- 
Pierre Marchand

--
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] recent changes

2009-07-21 Thread Pierre Marchand
Vous (Pierre Marchand) avez écrit :
> I’m getting into your recent changes and had a couple of trivial issues I
> wan’t to know if I must fix it myself or wait for you finish the work.
>
> + podofo_config.h is not installed.
> + HAVE_FONTCONFIG is publicly defined in podofo_config.h but not prefixed
> with "PODOFO_".

Going further I see there are rather more changes than I thought at first 
sight. 
It’s still not clear for me if podofo_config.h is intended to be public or 
just used at build time, I did notice it was missing when building apps 
relying on podofo that complained PDF_INT*_TYPENAME were not naming types.

Regarding deprecation of pdf_long as a  ptrdiff_t, the reasons for it are 
quite clear but I don’t see exactly what’s the new status of pdf_long. for 
exemple, when I see it in use in PdfMemStream::GetCopy, I wonder how it will 
behave when the uint64_t will be interpreted as a size_t in the memcpy call.

I continue to read the new stuff…


-- 
Pierre Marchand

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] recent changes

2009-07-21 Thread Pierre Marchand
Hi Craig,

I’m getting into your recent changes and had a couple of trivial issues I 
wan’t to know if I must fix it myself or wait for you finish the work. 

+ podofo_config.h is not installed.
+ HAVE_FONTCONFIG is publicly defined in podofo_config.h but not prefixed with 
"PODOFO_".


-- 
Pierre Marchand

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] PdfContentsTokenizer and inline image

2009-07-21 Thread Pierre Marchand
Vous (Thach Tran) avez écrit :
> I have quickly put together what you suggested earlier. The patch is
> attached in this message, feel free to give it a go. 

Great!

-- 
Pierre Marchand

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] A couple of segfaults

2009-06-27 Thread Pierre Marchand
Hi,

The attached PDF (D1.pdf) gave me hard time this morning when I tried to open 
it in PoDoFoBrowser. At first I’ve tracked down an overwrite of the filename 
passed to PdfMemDocument constructor by Fontconfig (which I’ll try to handle 
later). I rebuilt without Fontconfig and still crashed PoDoFoBrowser, this 
time in PdfInputDevice::Clear.
To be honest, I did not even try to understand why m_pStream was null and if 
it was legitimate or not, just checked for its nulliness and now it works.

Index: ../src/PdfInputDevice.h
===
--- ../src/PdfInputDevice.h (révision 1064)
+++ ../src/PdfInputDevice.h (copie de travail)
@@ -46,7 +46,7 @@
 PdfInputDevice( const char* pszFilename );

 #ifdef _WIN32
-#if defined(_MSC_VER)  &&  _MSC_VER <= 1200// nicht f�r 
Visualstudio 6
+#if defined(_MSC_VER)  &&  _MSC_VER <= 1200// nicht f�r 
Visualstudio 6
 #else
 /** Construct a new PdfInputDevice that reads all data from a file.
  *
@@ -186,7 +186,8 @@

 void PdfInputDevice::Clear(std::ios_base::iostate state) const
 {
-m_pStream->clear(state);
+   if(m_pStream)
+   m_pStream->clear(state);
 }

 };

bon courage

-- 
Pierre Marchand


D1.pdf
Description: Adobe PDF document
--
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] failed to get page 0

2009-06-24 Thread Pierre Marchand
Hi Dom,

I had a problem to get the first page of  [1]. I’ve worked around without 
really understanding the problem with this change (which is not a fix, it 
returned page 0 for page 1 as well as far as I understood):

Index: src/PdfPagesTree.cpp 
   
=== 
   
--- src/PdfPagesTree.cpp(révision 1056) 
   
+++ src/PdfPagesTree.cpp(copie de travail)  
   
@@ -300,7 +300,8 @@ 
   
 else // Type == Page   
   
 {  
   
 // Skip a normal page  
   
-nPageNum--;
+if(nPageNum > 0 )
+   nPageNum--;
 if( 0 == nPageNum )
 {
 rLstParents.push_back( pParent );

Prevent requested page number to go below 0 at this point is certainly a bit 
too late in the process but I’ve been unable to spot where it was wrong 
before. Hope you’ll be smarter than me :)

[1]  <http://partners.adobe.com/public/developer/en/font/T1_SPEC.PDF>

-- 
Pierre Marchand

--
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Invalid Root Object

2009-06-22 Thread Pierre Marchand
Vous (Dominik Seichter) avez écrit :
> Hi,
>
> I got a PDF file which can be correctly read and written using PoDoFo.
> After writing with PoDoFo, one cannot open the file with Acrobat Reader.
>
> Acrobat Reader reports the following error: "There was an error opening
> this document.  The root object is missing or invalid.". GhostScript is
> also not able to open the PDF whereas Poppler/KPDF and PoDoFo can read the
> file.
>
> I am stuck and not able to see why the root object seems to be invalid.
> Does anyone have any ideas?
>
> The original file can be found here:
> http://krename.sourceforge.net/data/podofo/PAN_cscicur.pdf
>
> The file created by PoDoFo which causes the error can be found here:
> http://krename.sourceforge.net/data/podofo/podofo.pdf
>
> Any help is appreciated!
>
> best regards,
>   Dom

I haven’t time to help much, but still here are few things:
a) GS opens it without complaining here (version 8.62)
b) I removed the /Metadata key with podofobrowser and after that acroread did 
open the file, just showing a very fast dialog "…damaged…rebuild…" (couldn’t 
read more). 

HTH

-- 
Pierre Marchand

--
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] podofobrowser

2009-06-10 Thread Pierre Marchand
Le Thursday 21 May 2009 11:09:49 Pierre Marchand, vous avez écrit :
> Le Thursday 21 May 2009 02:15:30 Craig Ringer, vous avez écrit :
> > If it doesn't break anything then sure, it'd be great.
>
> The way I did it is very simple, basically used same logic as for
> export/import stream but without the need to edit in a text editor. I’ll
> try to commit soon in Trunk and then let people try to break it :)

Finally done.  

-- 
Pierre Marchand

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] podofobrowser

2009-05-21 Thread Pierre Marchand
Le Thursday 21 May 2009 02:15:30 Craig Ringer, vous avez écrit :
> If it doesn't break anything then sure, it'd be great.

The way I did it is very simple, basically used same logic as for 
export/import stream but without the need to edit in a text editor. I’ll try 
to commit soon in Trunk and then let people try to break it :)

> font  extraction

I copied the code from -viewer in Fontmatrix to provide such a feature[1]. 
Actually it does not support Type3 fonts but it does some interesting job yet.

[1] <http://www.fontmatrix.net/node/43>

-- 
Pierre Marchand

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] podofobrowser

2009-05-20 Thread Pierre Marchand
Le Wednesday 20 May 2009 14:28:48 Dominik Seichter, vous avez écrit :
> Thanks again for the video! This is very cool. But did you actually commit
> your changes to the -viewer branch? I did not see any messages on
> podofo-svn lately.

This is in the -viewer branch already. I haven’t had time to do more work on 
it but I use it as my default podofobrowser here. I hope I’ll be able to find 
time to continue on it at least to be at a point  that speaking of a PDF 
importer in Scribus, even very basic, would be possible :)


PS: eventually there was something to commit! Still work in progress code tho.

-- 
Pierre Marchand

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] podofobrowser

2009-05-19 Thread Pierre Marchand
Hi,

reminder: as part of my work in podofobrowser-viewer branch, I  made the 
content stream view "editable", it has its flaws (possible encoding issues) 
but I used it here from time to time to slightly edit PDFs and it worked 
fine[1].

What would you think to see this part of the -viewer branch merged into Trunk? 

[1] I can’t resist, here is a video clip demonstrating the thing - 
<http://oep-h.com/documents/podofo/pdf_editing.ogv> :-)
-- 
Pierre Marchand

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Universal build on Mac OSX

2009-04-27 Thread Pierre Marchand
Le Monday 27 April 2009 15:04:38 Michael Marsella, vous avez écrit :
> Leonard Rosenthol wrote:
> > I would be pretty surprised to find anyone building NEW software for
> > PPC...

Why not? It’s a characteristic of free software to be often built on a variety 
of platforms by a variety of users. And it’s not yet so unusual to see people 
with an Apple box running a PPC. As long as it’s not a pain to support this 
platform, I think it’s fine to do it. Though I do agree there’s something 
extraordinary seeing us fighting to please users for whatever reason :-) 

> At anyrate, I just wanted to also mention you could wrap the whole block
> in a mac platform check if you like:
>
> #ifdef MAC_ENV
>
>ifdef __ppc__
>   #define PODOFO_IS_BIG_ENDIAN
>#else
>   #define PODOFO_IS_LITTLE_ENDIAN
>#endif
>
> #endif
>

Thanks, I think I’ll submit a patch based on  your changes to MacPorts without 
committing in PoDoFo.

-- 
Pierre Marchand

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] Universal build on Mac OSX

2009-04-26 Thread Pierre Marchand
Hi,

I had some issues with the universal variant of the PoDoFo version (0.7.0) 
provided by MacPorts when building both Fontmatrix and Scribus. I must say I 
can’t make up my mind concerning the best  way to fix it. I’ve filed a bug 
report on their tracker <http://trac.macports.org/ticket/19418>  It led to the 
observation that there was a mechanism to detect endianess at configure time 
--as opposed to compile time-- which prevents to build a true universal 
version of the library.

Ideas? Is this even a issue from your point of view? 

-- 
Pierre Marchand

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] In use

2009-03-16 Thread Pierre Marchand
Hi,

A bit of fun in this sunny monday morning:
http://www.oep-h.com/documents/podofo/making_off.pdf

* I don’t know if it’s really the place for such messages, but I thought it 
was nice to show what we do with PoDoFo, nicer than patches :)

-- 
Pierre Marchand

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] PoDoFo in use

2009-02-25 Thread Pierre Marchand
Hi,

Briefly, after the week-playing with PoDoFoBrowser which resulted in the 
experimental branch implementing a "viewer", i’ve came back to my other 
projects. And today, roughly copying code from the viewer into Fontmatrix, 
I’ve been able to build a rudimentary font extractor. It’s more about the fun 
than something else, but still, it is fun :-)

http://www.fontmatrix.net/multimedia/extract_font.ogv

Thanks again Dom for the nice lib!

-- 
Pierre Marchand

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] crash when creating pages

2009-02-13 Thread Pierre Marchand
Vous (Dominik Seichter) avez écrit :
> > At this point I'm wondering about a bug in the pages tree code, perhaps
> > related to management of the kidsArray. It's 1am here, so I'm not going
> > to look into it any more right now, but that may set you on the right
> > track. If not I'll try to check into it later.
> >
> > It's certainly not your local setup; it's a PoDoFo bug.
> >
> > --
> > Craig Ringer
>
> This seems to be an issue in the pages tree. It needs desperately to be
> fixed! There are several issues and no one seems to really know the code to
> be able to fix it.
> I am already thinking about reimplementing it when I get some free time.
> But in the near future I do not think I can come up with a good solution
> for all the issues in the pages tree :(
>


Here is a random fix. It’s based on a step by step run of the example code I 
did send. It’s really weird that it works as it introduces a logical error 
when fixing a wrong array access. I won’t commit it ant will continue to 
investigate. But if you need to quickly work around the issue, which was my 
case, give it a try!



-- 
Pierre Marchand
Index: src/PdfPagesTree.cpp
===
--- src/PdfPagesTree.cpp	(révision 990)
+++ src/PdfPagesTree.cpp	(copie de travail)
@@ -113,13 +113,14 @@
 // or pages nodes with a kid count of 1, so we can speed things up by going straight to the desired node
 if ( numKids == kidsCount )
 {
-if( nPageNum >= static_cast(kidsArray.size()) )
+	int kidsArraySize = static_cast(kidsArray.size());
+	if( nPageNum >=  kidsArraySize)
 {
 PdfError::LogMessage( eLogSeverity_Critical, "Requesting page index %i from array of size %i\n", nPageNum, kidsArray.size() );
 /*
 PODOFO_RAISE_ERROR( ePdfError_ValueOutOfRange );
 */
-nPageNum--;
+	nPageNum = kidsArraySize - 1;
 }
 
 PdfVariant pgVar = kidsArray[ nPageNum ];
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] crash when creating pages

2009-02-04 Thread Pierre Marchand
Hi,

I ran into an issue for which i cannot find an answer. It’s about creating 
pages through a PdfMemDocument. In that matter, few lines of source code are 
better than a long explanation. I join sample code which simply crashes, same 
kind of construction in podofoimpose throws an exception in  
PdfVariant::DelayedLoadImpl(). Might be obvious, or late, but I don’t see it.

In the hope it’s related to my local setup.

-- 
Pierre Marchand
#include 
#include 

int main()
{
PoDoFo::PdfMemDocument* doc = new PoDoFo::PdfMemDocument;

int np(10); 
PoDoFo::PdfRect rect( 0.0, 0.0, 100, 100 );
for(int i(0);i < np; ++i)
{
  try
  {
doc->CreatePage( rect );
  }
  catch(PoDoFo::PdfError& e)
  {
std::cerr<<"Unable to create new page "
<< i 
<< ": "
<<  PoDoFo::PdfError::ErrorMessage( e.GetError() )
<< std::endl;
return 1;
  }
}
delete doc;
return 0;
}--
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Using PdfDictionary and PdfArray

2009-01-20 Thread Pierre Marchand
Vous (Michael Marsella) avez écrit :
> I noticed that 2 of the classes I am using to establish the logical
> structure (PdfDictionary and PdfArray) are not part of the API
> documentation, but both seem to have public members and are quite
> usable, I am wondering first off if there is some reason they are not
> documented? Maybe I am somehow not using them correctly or should not
> use them?

I ran into same problem once and just edited the Doxygen file to get more 
extensive doc. Here it is.



-- 
Pierre Marchand
# Doxyfile 1.4.2

#---
# Project related configuration options
#---
PROJECT_NAME   = PoDoFo
PROJECT_NUMBER = 0.7.0
OUTPUT_DIRECTORY   = doc
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE= English
USE_WINDOWS_ENCODING   = NO
BRIEF_MEMBER_DESC  = YES
REPEAT_BRIEF   = YES
ABBREVIATE_BRIEF   = "The $name class" \
 "The $name widget" \
 "The $name file" \
 is \
 provides \
 specifies \
 contains \
 represents \
 a \
 an \
 the
ALWAYS_DETAILED_SEC= NO
INLINE_INHERITED_MEMB  = NO
FULL_PATH_NAMES= NO
STRIP_FROM_PATH= 
STRIP_FROM_INC_PATH= 
SHORT_NAMES= NO
JAVADOC_AUTOBRIEF  = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS   = YES
DISTRIBUTE_GROUP_DOC   = NO
SEPARATE_MEMBER_PAGES  = NO
TAB_SIZE   = 8
ALIASES= 
OPTIMIZE_OUTPUT_FOR_C  = NO
OPTIMIZE_OUTPUT_JAVA   = NO
SUBGROUPING= YES
#---
# Build related configuration options
#---
EXTRACT_ALL= YES
EXTRACT_PRIVATE= NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES  = YES
EXTRACT_LOCAL_METHODS  = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS  = NO
HIDE_IN_BODY_DOCS  = NO
INTERNAL_DOCS  = NO
CASE_SENSE_NAMES   = YES
HIDE_SCOPE_NAMES   = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO= YES
SORT_MEMBER_DOCS   = YES
SORT_BRIEF_DOCS= NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST  = YES
GENERATE_TESTLIST  = YES
GENERATE_BUGLIST   = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS   = 
MAX_INITIALIZER_LINES  = 30
SHOW_USED_FILES= YES
SHOW_DIRECTORIES   = NO
FILE_VERSION_FILTER= 
#---
# configuration options related to warning and progress messages
#---
QUIET  = NO
WARNINGS   = YES
WARN_IF_UNDOCUMENTED   = YES
WARN_IF_DOC_ERROR  = YES
WARN_NO_PARAMDOC   = NO
WARN_FORMAT= "$file:$line: $text"
WARN_LOGFILE   = 
#---
# configuration options related to the input files
#---
INPUT  = src/
FILE_PATTERNS  = *.cpp \
 *.h
RECURSIVE  = YES
EXCLUDE= 
EXCLUDE_SYMLINKS   = NO
EXCLUDE_PATTERNS   = 
EXAMPLE_PATH   = test/ ./
EXAMPLE_PATTERNS   = *
EXAMPLE_RECURSIVE  = YES
IMAGE_PATH = 
INPUT_FILTER   = 
FILTER_PATTERNS= 
FILTER_SOURCE_FILES= NO
#---
# configuration options related to source browsing
#---
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
STRIP_CODE_COMMENTS= YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION= YES
VERBATIM_HEADERS   = NO
#---
# configuration options related to the alphabetical class index
#---
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX= 5
IGNORE_PREFIX  = Pdf
#---
# configuration options related to the HTML output
#---
GENERATE_HTML  = YES
HTML_OUTPUT= html
HTML_FILE_EXTENSION= .html
HTML_HEADER= 
HTML_FOOTER= 
HTML_STYLESHEET= 
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP  = NO
CHM_FILE 

Re: [Podofo-users] podofobrowser experiences

2009-01-12 Thread Pierre Marchand
Vous (Dominik Seichter) avez écrit :
> I hope you find the time for branching soon!

Done! I don’t know if I’ll have time to work a lot on it, but at least what’s 
been done won’t be lost :)

SVN repo is: 
https://podofo.svn.sourceforge.net/svnroot/podofo/podofobrowser/branches/podofobrowser-
viewer

A screenshot showing rather correct handling of Type1 fonts:
http://www.oep-h.com/documents/podofo/podoview2.png

Another idea comes to my mind, as elements are displayed through a 
QGraphicsView descendant, it can be printed[1] without effort …

[1]http://doc.trolltech.com/4.4/qgraphicsview.html#render

-- 
Pierre Marchand

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] version, soname, etc.

2009-01-09 Thread Pierre Marchand
Hi Dom,

I don’t know nothing about this kind of stuff but I guess there’s something 
wrong with this:
src/CMakeLists.txt:VERSION "0.6.99" 
src/CMakeLists.txt:SOVERSION "0.6.99"  

I let you handle it.

-- 
Pierre Marchand

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] podofobrowser experiences

2009-01-07 Thread Pierre Marchand
Vous (Leonard Rosenthol) avez écrit :
> Someone did a Qt-based renderer for PDF (using Xpdf as the backend), so I
> know it can be done...

I don’t know about this specific project, but since XPdf has been turned into 
libpoppler, and considering there’s a _binding_ for Qt4, it’s trivial to write 
a simple PDF viewer. It’s something i should still consider to do for 
podofobrowser (the same i did for fontmatrix, a freetype rendering and a 
native Qt one, the factory thing in fact). Now, as you can guess, the reason i 
do it is that you can either edit documents with PoDoFo, so getting a 
rasterized version of a page is not enough for that. TBH, I don’t know where 
it leads me but it’s fun :) 

Dom, here what you asked for:
http://www.oep-h.com/documents/podofo/podoview-0.0.0.ogv
I’ll try to find time to branch the Podofobrowser directory soon as to let 
people enjoy the code.

-- 
Pierre Marchand

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] podofobrowser experiences

2009-01-01 Thread Pierre Marchand
Hi,

I’ve played a bit with Podofobrowser. And here is an insomnia-patch^^concept 
which allow  viewing of content streams (to be honest, just paths). The result 
is not really interesting but i would be happy to get your opinions about the 
way it’s done and eventually if you see obvious problems which would prevent 
to add support for some kind of objects. I know the fastest way would be to 
just use Poppler, but I’m happy at hacking PDFs and would be thrilled to 
support manipulation of PDF objects.

TIA

-- 
Pierre Marchand
Index: src/podofobrowserbase.ui
===
--- src/podofobrowserbase.ui	(révision 986)
+++ src/podofobrowserbase.ui	(copie de travail)
@@ -5,7 +5,7 @@

 0
 0
-758
+891
 629

   
@@ -13,25 +13,11 @@
PoDoFo Browser
   
   
-   
-
- 0
- 58
- 758
- 571
-
-   
-   
-
- 6
-
-
- 9
-
-
+   
+
  
   
-   Qt::Vertical
+   Qt::Horizontal
   
   

@@ -47,24 +33,18 @@
 true

   
-  
-   
-Qt::Horizontal
-   
-   
-
- Qt::Vertical
-
-
- 
-  
-   6
-  
-  
-   0
-  
+  
+   
+
+ 
   

+
+ 
+  2
+  0
+ 
+
 
  Contents of the associated stream:
 
@@ -74,131 +54,129 @@

   
   
-   
+   
 
- 
+ Show Preview (if possible)
 
-
- false
+
+ true
 

   
-  
-   
-
- 0
-
-
- 
-  
-   0
-   0
-   738
-   246
-  
- 
- 
-  
-   
-
- false
-
-
- false
-
-
- false
-
-   
-  
- 
-
-
- 
-  
-   0
-   0
-   738
-   246
-  
- 
- 
-  
-   
-  
- 
-
-   
-  
-  
-   
-
- 6
-
-
- 0
-
+ 
+
+
+ 
+  
+   
+  
+  
+   false
+  
+ 
+
+
+ 
+  
+   0
+  
+  
+   
 
- 
-  
+ 
+  
false
   
-  
-   &Import Stream ...
+  
+   false
   
-  
-   Alt+I
-  
- 
-
-
- 
-  
+  
false
   
-  
-   &Export Stream ...
-  
-  
-   Alt+E
-  
  
 
+   
+  
+  
+   
 
- 
-  
-   Qt::Horizontal
-  
-  
-   QSizePolicy::Expanding
-  
-  
-   
-241
-21
-   
-  
- 
+ 
 

+  
+  
+   
+
+ 
+
+   
+  
+ 
+
+
+ 
+  
+   6
+  
+  
+   0
+  
+  
+   
+
+ false
+
+
+ &Import Stream ...
+
+
+ Alt+I
+
+   
   
+  
+   
+
+ false
+
+
+ &Export Stream ...
+
+
+ Alt+E
+
+   
+  
+  
+   
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Expanding
+
+
+ 
+  241
+  21
+ 
+
+   
+  
  
-
-   
+
+   
+   
+   labelStream
+   textStream
+   stackedWidget
+   
   
  
 

   
   
-   
-
- 0
- 24
- 758
- 34
-
-

Re: [Podofo-users] PoDoFo 0.7.0 released

2009-01-01 Thread Pierre Marchand
Vous (Dominik Seichter) avez écrit :
> Hi folks!
>
> PoDoFo 0.7.0 is available for download. It has been tested on several Linux
> and Windows systems. Thanks to everyone who has contributed to this release
> and made it therefore possible!
>
> The most important changes are:
> * Many improvements to podofoimpose our PDF imposition tool, most notably
> support Lua plan files. Try also the Online-based PDF imposition with
> PoDoFo. * Full unicode support on both Windows and Linux plattforms
> * Initial work on font subsetting
> * Fixed a few memory leaks
> * Fixed several parsing issues
> * Countless smaller bug fixes
>
> I wish everyone a Happy New Year!
>
> best regards,
>   Dom

Thanks to you Dom! That is nice new year present :)

-- 
Pierre Marchand
http://www.oep-h.com



--
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Locating/reading a string in a PDF

2008-11-24 Thread Pierre Marchand
Vous (Virgiliu Craciun) avez écrit :
> I would be grateful to the PoDoFo community for any related help (how to do
> it), or C++ example/source code that would save us time.

I think you can find something in tools/podofotxtextract.

HTH

-- 
Pierre Marchand

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Linking error when compiling with Lua support

2008-11-24 Thread Pierre Marchand
Vous (Dominik Seichter) avez écrit :
> If it helps to drop lua50 support, I have no objections if you do that.
+1

Podofoimpose is still usable without Lua, and those who want it can upgrade.

-- 
Pierre Marchand

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Linking error when compiling with Lua support

2008-11-23 Thread Pierre Marchand
Vous (Dominik Seichter) avez écrit :
> Hi,
>
> When compiling with latest trunk, I get this error message when linking
> podofoimpose:

Hi Dominik,

I’ve ran the web and found that it could be a 5.0/5.1 problem. i would not be 
surprised that Craig and I have only built it with 5.1 (as it’s what rpm 
reports here and it works fine).
I’ve no time today to do more. Maybe tonight :/

-- 
Pierre Marchand

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] PoDoFo bug reports

2008-10-29 Thread Pierre Marchand
Vous (Dominik Seichter) avez écrit :
> I think current SVN got already many more fixes than 0.6, so I would really
> like to release 0.7 before Christmas, if Craig and Pierre do agree.
>
> Maybe it's a good idea to do any major stream changes in a branch, but I
> leave that up to you Craig.
>
> To sum up, I'd like to have a release before Christmas (or on Christmas,
> usually that's a day I have some sparetime :) ) hopefully including the Lua
> work in podofoimpose.

For podofoimpose: 
a) I don’t think that people who actually use PoDoFo take care of it, as long 
as it builds quietly ;-)
b) the code is not clean at the moment but it mostly works;
c) I did not update the documentation but the default behaviour is left 
unchanged.

Conclusion, I think you can release as soon as you find enough time.

My 2 ¢

-- 
Pierre Marchand

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Lua-based impose plans

2008-10-15 Thread Pierre Marchand
First steps are done. 
Here are first plan files written in Lua which gave good results here.

I really hope that it will ease the developement of a comprehensive and rich 
set of plan files.

-- 
Pierre Marchand
-- Booklet

-- We output an A4 booklet
PageWidth = 595.27559
PageHeight = 841.88976

-- We assume that H > W
-- Argh, we now can do better since we have "if" ;-)
-- Scale = PageHeight / (2*SourceWidth)
if(SourceWidth <= SourceHeight)
then
Scale = PageHeight / (2*SourceWidth)
rot = 90
xof = SourceHeight
yofA = 0
yofB = SourceWidth
else
Scale = PageHeight / (2*SourceHeight)
rot = 0
xof = 0;
yofA = 0
yofB = SourceHeight
end

do
rest = PageCount % 4
totp = PageCount
if rest ~= 0
then 
totp = totp + ( 4 - rest)
end
inc = 0
count = 0
imax = totp/4
while count < imax
do
--  We assume that podofoimpose will discard invalid records
--  such as those with source page greater than PageCount

--  Recto
PushRecord(totp - inc , inc + 1 , rot, xof , yofA)
PushRecord(inc + 1 , inc + 1 , rot, xof , yofB)
--  Verso
PushRecord(inc + 2 , inc + 2 , rot, xof , yofB)
PushRecord(totp-(inc + 1) , inc + 2 , rot, xof, yofA)

count = count + 1
inc = inc + 2
end
end-- Identity - a test script for podofoimpose

-- Required
PageWidth = SourceWidth
PageHeight = SourceHeight

-- Records
i = 1
while i <= PageCount
do
PushRecord( i , i ,0,0,0)
i = i + 1
end

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Lua-based impose plans

2008-10-08 Thread Pierre Marchand
Vous (Craig Ringer) avez écrit :
> Hi
>
> I've bashed out an initial implementation of Lua-based imposition plans.
> It's not hooked up to the main podofoimpose code yet, but so far it
> looks to be embarrassingly simple. I really only have to export one
> function to the Lua interpreter (to register a new imposition record)
> and push a couple of environment variables in to the initial execution
> context.
>
> I'll attach the code - which hasn't been built and will need fixes since
> I've done a less comprehensive reading of the Lua docs than I should've
> - to give you a vague idea what's involved.
>
> The Plan class is very close to the existing PageRecord class; I
> should've just separated that out instead.
>
> I should have a working patch plus some sample plans over the next few
> days, though that depends a lot on just how busy those next few days are.
>
> This is just code intended as a guide for how it'll look. It can replace
> the parser and expression evaluation stuff in podofoimpose entirely.
> Additionally, it'd be possible to use a SAX parser to load imposition
> plans from XML rather trivially, too, since the Plan structure is
> entirely separate from any podofoimpose implementation details. This
> should make people who want to write GUI planners in other languages and
> use the podofoimpose executable as a backend happy.
>
> Like where I'm going?
>
> --
> Craig Ringer

Wow, i’ve wrote something with almost similar design this afternoon! Although 
i’ve began by reimplementing the actual code in a separate class first, what 
led me to deeply clean up pdftranslator class. I guess there aren’t too much 
options then and i will happily mix your code with mine.
As the only _big_ difference with what I write is that "addrec" would 
be "PushRecord", even your PLAN files should easily convert. Oh, there is 
something different, I would not provide other set/get method than 
setNumber/getNumber.

Here we say : "les grands esprits se rencontrent" :)

Note: If at first I just wrote 2 classes ReadPlan_legacy and ReadPlan_Lua, I 
know think to have a base class ReadPlan and implement something 
like "strategy" pattern to pickup the right descendant depending of user 
input or automatic detection. What do you think?

-- 
Pierre Marchand

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] floating point values

2008-08-06 Thread Pierre Marchand
As a quick workaround for output of floating point values (in SVN Head):

Index: src/PdfVariant.cpp
===
--- src/PdfVariant.cpp  (révision 887)
+++ src/PdfVariant.cpp  (copie de travail)
@@ -230,7 +230,7 @@
 // Use ostringstream, so that locale does not matter
 std::ostringstream oss;
 PdfLocaleImbue(oss);
-oss << m_Data.dNumber;
+   oss << std::fixed << m_Data.dNumber;

 pDevice->Write( oss.str().c_str(), oss.str().size() );
 break;


I don’t know at all if it can be seen as a fix but at least it worked here 
(opensuse 10.3).

-- 
Pierre Marchand

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] [Podofo-svn] SF.net SVN: podofo:[886] podofo/trunk/tools/podofoimpose

2008-08-05 Thread Pierre Marchand
Vous (Leonard Rosenthol) avez écrit :
> On Aug 4, 2008, at 9:02 AM, [EMAIL PROTECTED] wrote:
> > podofoimpose - Many fixes in loop operator (@) and, most noticeably,
> > produced document is now an actual new one rather that the trimmed
> > source document. Therefore, a lot of problems remain because we need
> > to carefully gather _and_ copy resources from the source document.
>
>   Trimming the source file is going to give you MUCH GREATER
> performance in imposition then creating a new document...

I guess you’re right. I’ve came in thinking it would be good to make a new 
document after having been frustrated when deleting source pages was throwing 
exceptions. Now I must admit I’m excited by the challenge of recreating a 
consistant imposed new document and I think i’ll end up offering choice to 
the user between the two options --- because it seems reasonnable to think 
that one or the other could work better under some circumsatnces.

-- 
Pierre Marchand

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] podofoimpose needs to be tested.

2008-08-04 Thread Pierre Marchand
Hi,
It seems that i’ve turned podofoimpose into something much complicated now :) 
As a result, i hardly can track down some of the errors I get. i joined the 
plan file with which I did impose pdf_reference_1-7.pdf, seemingly 
successfuly but acroread still complains.

-- 
Pierre Marchand
## don’t know where i’m going with thet
## but here’s my attempt to impose PDF reference
## with PoDoFoImpose. pm

# source page size is 7.38 x 9.25 in
# number of pages 1310 !!!

$PageWidth=2383.94
$PageHeight=3370.39

$spw=531.36
$sph=666

$vgap=40
$hgap=40

$xoffset=40
$yoffset=300

$lp=1
$gp=0

@41($lp+2;$gp+32)
 P1 ##

# first row P1
17 +$gp;$lp;180;$xoffset + $spw;$yoffset + (3*$vgap) + 
(3*$sph) + $sph;
16 +$gp;$lp;180;$xoffset + $spw + $hgap+ $spw;  $yoffset + 
(3*$vgap) + (3*$sph)+ $sph;
9  +$gp;$lp;180;$xoffset + ($spw*2) + ($hgap*2)+ $spw;  
$yoffset + (3*$vgap) + (3*$sph)+ $sph;
24 +$gp;$lp;180;$xoffset + ($spw*3) + ($hgap*3)+ $spw;  
$yoffset + (3*$vgap) + (3*$sph)+ $sph;

# second row P1
32 +$gp;$lp;0;  $xoffset;   $yoffset + (2*$vgap) + (2*$sph);
1  +$gp;$lp;0;  $xoffset + $spw + $hgap;$yoffset + 
(2*$vgap) + (2*$sph);
8  +$gp;$lp;0;  $xoffset + ($spw*2) + ($hgap*2);
$yoffset + (2*$vgap) + (2*$sph);
25 +$gp;$lp;0;  $xoffset + ($spw*3) + ($hgap*3);
$yoffset + (2*$vgap) + (2*$sph);

# third row P1
29 +$gp;$lp;180;$xoffset + $spw;$yoffset + ($vgap) + 
($sph) + $sph;
4  +$gp;$lp;180;$xoffset + $spw + $hgap + $spw;  $yoffset + 
($vgap) + ($sph) + $sph;
5  +$gp;$lp;180;$xoffset + ($spw*2) + ($hgap*2) + $spw; 
$yoffset + ($vgap) + ($sph) + $sph;
28 +$gp;$lp;180;$xoffset + ($spw*3) + ($hgap*3) + $spw; 
$yoffset + ($vgap) + ($sph) + $sph;


# fourth row P1
20 +$gp;$lp;0;  $xoffset;   $yoffset ;
13 +$gp;$lp;0;  $xoffset + $spw + $hgap;$yoffset ;
12 +$gp;$lp;0;  $xoffset + ($spw*2) + ($hgap*2);
$yoffset ;
21 +$gp;$lp;0;  $xoffset + ($spw*3) + ($hgap*3);
$yoffset ;

 P2 ##

# first row P2
23 +$gp;$lp + 1;180;$xoffset + $spw;$yoffset + 
(3*$vgap) + (3*$sph) + $sph;
10 +$gp;$lp + 1;180;$xoffset + $spw + $hgap+ $spw;  
$yoffset + (3*$vgap) + (3*$sph)+ $sph;
15 +$gp;$lp + 1;180;$xoffset + ($spw*2) + ($hgap*2)+ $spw;  
$yoffset + (3*$vgap) + (3*$sph)+ $sph;
18 +$gp;$lp + 1;180;$xoffset + ($spw*3) + ($hgap*3)+ $spw;  
$yoffset + (3*$vgap) + (3*$sph)+ $sph;

# second row P2
26 +$gp;$lp + 1;0;  $xoffset;   $yoffset + (2*$vgap) + 
(2*$sph);
7  +$gp;$lp + 1;0;  $xoffset + $spw + $hgap;
$yoffset + (2*$vgap) + (2*$sph);
2  +$gp;$lp + 1;0;  $xoffset + ($spw*2) + ($hgap*2);
$yoffset + (2*$vgap) + (2*$sph);
31 +$gp;$lp + 1;0;  $xoffset + ($spw*3) + ($hgap*3);
$yoffset + (2*$vgap) + (2*$sph);

# third row P2
27 +$gp;$lp + 1;180;$xoffset + $spw;$yoffset + 
($vgap) + ($sph) + $sph;
6  +$gp;$lp + 1;180;$xoffset + $spw + $hgap + $spw; 
$yoffset + ($vgap) + ($sph) + $sph;
3  +$gp;$lp + 1;180;$xoffset + ($spw*2) + ($hgap*2) + $spw; 
$yoffset + ($vgap) + ($sph) + $sph;
30 +$gp;$lp + 1;180;$xoffset + ($spw*3) + ($hgap*3) + $spw; 
$yoffset + ($vgap) + ($sph) + $sph;


# fourth row P2
22 +$gp;$lp + 1;0;  $xoffset;   $yoffset ;
11 +$gp;$lp + 1;0;  $xoffset + $spw + $hgap;
$yoffset ;
14 +$gp;$lp + 1;0;  $xoffset + ($spw*2) + ($hgap*2);
$yoffset ;
19 +$gp;$lp + 1;0;  $xoffset + ($spw*3) + ($hgap*3);
$yoffset ;

@ END OF LOOP






-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] cmake_install failed

2008-08-02 Thread Pierre Marchand
Vous (Craig Ringer) avez écrit :
> What version are you using ? The 0.6.0 release? A svn version (and if
> so, which revision) ?

Sorry, SVN Head (rev885) on Linux (opensuse).

>
> What CMake version do you have?

2.6.0

>
> What was the EXACT TEXT of the error message?
>

[...]
Install the project...
-- Install configuration: ""
-- Up-to-date: /home/pierre/system/include/podofo/Pdf3rdPtyForwardDecl.h
-- Up-to-date: /home/pierre/system/include/podofo/PdfAction.h
-- Up-to-date: /home/pierre/system/include/podofo/PdfAcroForm.h
-- Up-to-date: /home/pierre/system/include/podofo/PdfAnnotation.h
-- Up-to-date: /home/pierre/system/include/podofo/PdfArray.h
-- Up-to-date: /home/pierre/system/include/podofo/PdfCanvas.h
-- Up-to-date: /home/pierre/system/include/podofo/PdfColor.h
-- Up-to-date: /home/pierre/system/include/podofo/PdfContents.h
CMake Error at src/cmake_install.cmake:36 (FILE):
  file INSTALL cannot find file
  "/home/pierre/system/src/podofo/src/PdfContentsGraph.h" to install.
Call Stack (most recent call first):
  cmake_install.cmake:37 (INCLUDE)


> What arguments did you run cmake with?

cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/home/pierre/system ..

Hope it will be more useful like this.

-- 
Pierre Marchand

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] cmake_install failed

2008-08-01 Thread Pierre Marchand
Hi,
Since I’m not sure wether it’s just a local prolem or not i did not commit it 
but I’ve been forced to comment line 99 of src/CMakeLists.txt to install.
-- 
Pierre Marchand

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] PoDoFoImpose

2008-05-30 Thread Pierre Marchand
I’ve just noticed I did not post to the list - sorry

Vous (Dominik Seichter) avez écrit :
> Pierre, do you know what caused this error or why I need those to lines
> that where commented? I think that testing for EOF should never hurt and we
> should commit this patch. But I am sure you had a reason to do so.

I used to know why :) it was vaguely related to last record missing when there 
was a trailing empty line or something like that. But I’ve just tried various 
things right now and it seems to work fine with this check.

>
> After changing this for me, it worked super-fine. Creating the poster took
> about 2 seconds compared to Ghostscript which I canceled after 30 minutes.

C++ magic!
I wonder if the pageToXObject method you was talking about will speed up 
things.

>
> I had also another idea, what do you think of shipping some predefined plan
> files for this poster conversion? a1 -> a4 (portrait and landscape), a2 ->
> a4, a3 -> a4, etc. . I think it is quite  easy to create this plan files
> using any scripting language.

It would be nice. At this point my only concern is that each time I start to 
wonder how to compute imposition plans, I end up folding a bunch of paper and 
writing complicated formulae but I never got it! Well, perhaps for the poster 
thing I’ll manage to have it for 0.6, we’ll see.


-- 
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Footer on different paper sizes

2008-05-15 Thread Pierre Marchand
Vous (Ulrich Arnold) avez écrit :
> Hi Dom and Sebastian!
>
> May I remind you of the function PdfDocument::FillXObjectFromDocumentPage
> which we contributed. It should to the trick to convert pages to XObjects
> which can later be resized and positioned on the page.
>
> Uli

Did not know nothing about it!
I will rewrite podofimpose :)

-- 
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] podofoimpose tool

2008-05-05 Thread Pierre Marchand
Vous (Dominik Seichter) avez écrit :
> Do you think it would make sence to put
> these in a README which is installed along with podofoimpose somewhere
> to /usr/share/docs/podofo or even a man page? A README would have the
> advantage that it would work on all platforms whereas man pages are very
> useful on Unix.

At least it would allows other people than me to use it as well! If it has to 
be distributed, I’ll polish the examples for this purpose. In addition, if it 
can be done, it would be interesting to provide very simple PDF files which 
would be used to demonstrate what would be explained in the README.
I’ll do it next week, post-LGM.

-- 
Pierre Marchand

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] podofoimpose tool

2008-04-28 Thread Pierre Marchand
Hi,
I’ve regenerated my password and can now commit again.

It happened that I used podofoimpose these days and found some unexpected 
tricks I want to share with you.

*Add a stamp to a document*
Shame on me,  don’t even have a real stamp at my "office". So I tried 
something and it worked! Say you have that official one page A4 doc on which 
you want to add a nice stamp named official.pdf. You have your stamp in the 
file stamp.pdf. You first have to create two files :

== pdf.list ==
official.pdf
stamp.pdf
=

==stamponator.plan==
597.6 842.4
1 1 0 0 0
2 1 0 350 100
===

Now you can run:
podofoimpose  pdf.list stamped-official.pdf stamponator.plan 0

*Make a tiled poster*
I composed a 640x380 mm document in Scribus, I was thinking I could use the 
built-in Kprinter poster option to print it on my A4 laser printer. But no 
poster available on my OpenSuse box, so I thought I could give podofo a try.
Here is the plan file, it’s still not exact but since i get my poster printed 
I don’t bother too much :)

==poster.plan==
597.6 842.4
1 1 0 16.56 172.4
1 2 0 -547.92 172.4
1 3 0 -1112.4 172.4
1 4 0 -1676.88 172.4

1 5 0 16.56 -497.6
1 6 0 -547.92 -497.6
1 7 0 -1112.4 -497.6
1 8 0 -1676.88 -497.6
===

I ran a regular:
podofoimpose large.pdf poster.pdf poster.plan 0

*Multiple business cards on a sheet*
Classical need

==carte.plan
520.722 765.22
1 1 0 0 0
1 1 0 265.548 0
1 1 0 0 255.174
1 1 0 265.548 255.174
1 1 0 0 510.348
1 1 0 265.548 510.348
2 2 0 0 0
2 2 0 265.548 0
2 2 0 0 255.174
2 2 0 265.548 255.174
2 2 0 0 510.348
2 2 0 265.548 510.348


podofoimpose carte.pdf carte_imposed.pdf carte.plan 38.439

Note the sheet margin adjustment which lets room for the cut marks (if there 
is a relevant trim box[1] in the file), I can’t decide if it’s a bug or a 
feature! If the plan was generated automatically by a GUI app or something 
similar it would be a feature but when you have to compute it "by hand", it’s 
a real pain. Although it gives good results.

If it does not work for you, don’t hesitate to ask questions (hm, and write 
patches!).

[1] i don’t know if it’s documented somewhere but : "Trim" & "Crop" have the 
same length as for "Media" & "Bleed" so you can sometimes just use sed to do 
something useful without invalidate the XRef table. Think that a PDF/X-3 
generated by Scribus 1.3.3.x version has a mandatory TrimBox.

-- 
Pierre Marchand

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] Subversion account

2008-04-15 Thread Pierre Marchand
Re-Hi,

Something has changed for SVN access? I could not push some minor fixes in 
podofoimpose. Though it’s highly possible that I’ve broke something here too.

-- 
Pierre Marchand
Index: tools/podofoimpose/pdftranslator.cpp
===
--- tools/podofoimpose/pdftranslator.cpp	(révision 793)
+++ tools/podofoimpose/pdftranslator.cpp	(copie de travail)
@@ -122,7 +122,7 @@
 			if(ts.size() > 4)// at least ".pdf" because just test if ts is empty doesn't work.
 			{
 multiSource.push_back( ts );
-// std::cerr << "Appending "<< ts <<" to source" << endl;
+std::cerr << "Appending "<< ts <<" to source" << endl;
 			}
 		}
 		while ( !in.eof() );
@@ -257,35 +257,52 @@
 targetDoc = sourceDoc;
 outFilePath  = target;
 pcount = targetDoc->GetPageCount();
-
+std::cerr << "Document has "<< pcount << " page(s) " << endl;
 for ( int i = 0; i < pcount ; ++i )
 {
 PdfPage * page = targetDoc->GetPage ( i );
 PdfMemoryOutputStream outMemStream ( 1 );
 
 PdfXObject *xobj = new PdfXObject ( page->GetMediaBox(), targetDoc );
-	if(!page->GetContents()->IsArray())
+	if(page->GetContents()->HasStream())
 	{
 	page->GetContents()->GetStream()->GetFilteredCopy ( &outMemStream );
 	}
-	else
+	else if(page->GetContents()->IsArray())
 	{	
 		PdfArray carray(page->GetContents()->GetArray());
 		for(unsigned int ci = 0; ci < carray.GetSize(); ++ci)
 		{
-// 			std::cerr << " Appending stream from : ";
-			if(carray[ci].IsReference())
+// 			std::cerr << "carray at "<< ci <<" is "<< carray[ci].GetDataTypeString () <GetObjects().GetObject( carray[ci].GetReference() )->GetStream()->GetFilteredCopy ( &outMemStream );
+carray[ci].GetStream()->GetFilteredCopy ( &outMemStream );
 			}
-			else
+			else if(carray[ci].IsReference())
 			{
-// std::cerr << "stream" << endl;
-carray[ci].GetStream()->GetFilteredCopy ( &outMemStream );
+// std::cerr << "carray at "<< ci <<" is "<< carray[ci].GetReference().ToString() << endl;
+
+PdfObject *co = targetDoc->GetObjects().GetObject(carray[ci].GetReference());
+
+while(co != NULL)
+{
+	
+	if(co->IsReference())
+	{
+		co = targetDoc->GetObjects().GetObject(co->GetReference());
+	}
+	else if(co->HasStream())
+	{
+		co->GetStream()->GetFilteredCopy ( &outMemStream );
+		break;
+	}
+}
+
 			}
+			
 		}
 	}
+
 outMemStream.Close();
 
 PdfMemoryInputStream inStream ( outMemStream.TakeBuffer(),outMemStream.GetLength() );
@@ -295,6 +312,8 @@
 xobjects[i+1] = xobj;
 trimRect[i+1] = page->GetTrimBox();
 bleedRect[i+1] = page->GetBleedBox();
+	
+	std::cerr << "XObject added("<< i + 1 << ")" << endl;
 }
 }
 
@@ -321,8 +340,8 @@
 
 PageRecord p;
 in >> p;
-if (in.eof())
-break;
+// if (in.eof())
+// break;
 if (!p.isValid())
 throw runtime_error("Bad plan file record");
 
@@ -474,7 +493,6 @@
 if ( ! (sourceDoc && targetDoc) )
 throw std::invalid_argument("impose() called with empty source or destination path");
 
-PdfDictionary globalRes;
 
 double pw = destWidth + (2.0 * extraSpace) ;
 double ph = destHeight  + (2.0 * extraSpace);
@@ -510,8 +528,8 @@
 
 PdfArray matrix;
 
-double cosR = cos ( planImposition[index].rotate  *  3.14159 / 180 );
-double sinR = sin ( planImposition[index].rotate  *  3.14159 / 180 );
+double cosR = cos ( planImposition[index].rotate  *  3.14159 / 180.0 );
+double sinR = sin ( planImposition[index].rotate  *  3.14159 / 180.0 );
 double tx = planImposition[index].transX + extraSpace;
 double ty = planImposition[index].transY + extraSpace;
 
@@ -568,7 +586,15 @@
 newpage->GetResources()->GetDictionary().AddKey ( PdfName ( "XObject" ), xdict );
 ++git;
 }
+try{
 targetDoc->DeletePages ( 0,pcount );
+}
+catch( PoDoFo::PdfError & e )
+{
+	e.PrintErrorMsg();
+	std::cerr <<"For the above reason, PoDoFo didn't delete original pages,\nas we can live with that, process continues"<Write ( outFilePath.c_str() );
 
 }
-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] build error

2008-04-15 Thread Pierre Marchand
Hi,
I got this today:
/home/pierre/system/src/podofo/src/PdfParser.cpp:483: error: integer constant 
is too large for ‘long’ type
/home/pierre/system/src/podofo/src/PdfParser.cpp:484: error: integer constant 
is too large for ‘long’ type

with:
../podofo/src/PdfDefines.h:#define PODOFO_MAX_OBJ_NUMBER 99

So, I don’t know exactly what’s the "bizarre brain malfunction" but I changed 
it into  here[1] to have it compiling :) 

[1] OpenSuse 10.3 

$ rpm -qi gcc-c++-4.2-24
Name: gcc-c++  Relocations: (not relocatable)
Version : 4.2   Vendor: SUSE LINUX Products 
GmbH, Nuernberg, Germany
Release : 24Build Date: ven 21 sep 2007 
20:23:17 CEST
Install Date: sam 06 oct 2007 17:34:27 CEST  Build Host: glinka.suse.de
Group   : Development/Languages/C and C++   Source RPM: gcc-4.2-24.src.rpm
Size: 0License: GPL v2 or later
Signature   : DSA/SHA1, ven 21 sep 2007 20:26:44 CEST, Key ID a84edae89c800aca
Packager: http://bugs.opensuse.org
URL : http://gcc.gnu.org/
Summary : The system GNU C++ Compiler
Description :
The system GNU C++ Compiler.
Distribution: openSUSE 10.3 (i586)

$ uname -a
Linux portable 2.6.22.17-0.1-default #1 SMP 2008/02/10 20:01:04 UTC i686 i686 
i386 GNU/Linux

$rpm -qi glibc-2.6.1-18.3
Name: glibcRelocations: (not relocatable)
Version : 2.6.1 Vendor: SUSE LINUX Products 
GmbH, Nuernberg, Germany
Release : 18.3  Build Date: mar 23 oct 2007 
14:57:03 CEST
Install Date: mer 24 oct 2007 20:54:41 CEST  Build Host: linux-r2dp
Group   : System/Libraries  Source RPM: 
glibc-2.6.1-18.3.src.rpm
Size: 4045566  License: BSD 3-Clause; GPL v2 
or later; LGPL v2 or later
Signature   : DSA/SHA1, mar 23 oct 2007 17:36:16 CEST, Key ID a84edae89c800aca
Packager: http://bugs.opensuse.org
URL : http://www.gnu.org/software/libc/libc.html
Summary : Standard Shared Libraries (from the GNU C Library)
Description :
The GNU C Library provides the most important standard libraries used
by nearly all programs: the standard C library, the standard math
library, and the POSIX thread library. A system is not functional
without these libraries.
Distribution: openSUSE 10.3 (i686)

-- 
Pierre Marchand

-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] PdfObject::GetParent??

2008-02-18 Thread Pierre Marchand
Vous avez écrit :
> I believe that we have done so fro the ISO 32000 version of the
> document.
>
> Leonard

Leonard, could you quote what in ISO 32000 would bring light on this question? 
As what we read in PDF reference let us think that such a mechanism (partial 
inheritance) is not expected to happen.
Thanks

>
> On Feb 18, 2008, at 9:29 AM, Martin Schröder wrote:
> > 2008/2/18, Leonard Rosenthol <[EMAIL PROTECTED]>:
> >> No, that is not true.
> >>
> >> You can have individual parts inherited...
> >
> > IMHO that's not really clear from pages 123f of the PDF Ref 1.6; I
> > suggest clarifying it in future versions of the standard.
> >
> > Best
> >Martin
> >
> > --
> > ---
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> > ___
> > Podofo-users mailing list
> > Podofo-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/podofo-users
>
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> Podofo-users mailing list
> Podofo-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/podofo-users



-- 
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] PdfObject::GetParent??

2008-02-17 Thread Pierre Marchand
Vous avez écrit :
> They way I understand the PDF spec, that's not possible. Either the
> Resources dictionary
> is inherited as a whole or not at all:

I guess I lost myself into complication. Thanks for the light.

-- 
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] PdfObject::GetParent??

2008-02-17 Thread Pierre Marchand
Vous avez écrit :
> > Another problem, at least I found it problematistic, was to have
> > all resources
> > in an unique object. I wrote
> > PdfTranslator::mergeResKey(PdfObject *base,PdfName key, PdfObject
> > *tomerge)
> > to adress this.
>
> I don't need that. Each included page becomes a separate XObject with
> its private
> Resources dictionary.

I do the same. But I found it was required to merge different keys from 
different Resources dictionaries into one  to attach to the XObject. My idea 
was it is possible to have a font entry in a Resource dict. at a page level 
whereas a colorspace or an XObject has to be inherited from an ancestor. It’s 
just an example but I think it indicates that at some point you could have to 
pack resources from different objects into one dictionnary, though I didn’t 
checked with PDFs from various apps if it ever happens.

-- 
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] PdfObject::GetParent??

2008-02-17 Thread Pierre Marchand
Vous avez écrit :
> > BTW: I'm want to use that method for looking up the /Resources in the
> > page tree. Maybe PdfPage::GetResources() should do that
> > automatically? Same with other inherited attributes?
>
> GetResources() obtains access to the resources object its self, allowing
> the user to manipulate it. It'd certainly be very useful to have a
> separate method to obtain a list of all required resource, both local
> and inherited, though.
>
> I'm not sure how podofoimpose handles this, and I have to head out now.
> I wouldn't be too surprised if it's relying on podofo's unused indirect
> object garbage collection.

For what I’m concerned, I was rather curious to see how Andreas would manage 
to retrieve all resources! To be honest, the way I do this in podofoimpose is 
a bit rough, asking for Resources dictionary at each level and go up with   
"rparent = rparent->GetIndirectKey( "Parent" );". You can read this in 
PdfObject* PdfTranslator::getInheritedResources(PdfPage* page).
Another problem, at least I found it problematistic, was to have all resources 
in an unique object. I wrote 
PdfTranslator::mergeResKey(PdfObject *base,PdfName key, PdfObject *tomerge)
to adress this. All in all, I would have like to find these methods into 
PoDoFo itself because not being a developer, I’m pretty sure these methods 
are suboptimal and not enough tested, if at all. 

-- 
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Parsing content streams

2007-11-23 Thread Pierre Marchand
Le Thursday 08 November 2007 12:33:39 Pierre Marchand, vous avez écrit :
> Le Thursday 08 November 2007 11:08:14 Craig Ringer, vous avez écrit :
> > I've put together a quick reader based on Dom's code that can be used to
> > read a content stream an operator at a time, returning a pair containing
> > the string representation of the operator and a vector of PdfVariant
> > operands. There's also a simple function to accumulate the lot of them
> > if you want to read a whole stream at once.
>
> Does it mean that with a PdfOperator wrapper class which could register
> methods to do actual job, a renderer could be written incrementally and
> more or less easily ?

I took minutes to try with test/ContentParser. I guess you’ll find the code 
ugly but I can’t help to take part in this game :-)

-- 
Pierre Marchand
Index: test/ContentParser/main.cpp
===
--- test/ContentParser/main.cpp	(révision 755)
+++ test/ContentParser/main.cpp	(copie de travail)
@@ -10,20 +10,111 @@
 using namespace std;
 using namespace PoDoFo;
 
+struct PdfContentOperator
+{
+	std::string key;
+	int num_args;
+	void *userData;
+	void (*method)(std::stack);
+	PdfContentOperator(std::string k, int n, void *u, void (*m)(std::stack))
+	:key(k), num_args(n), userData(u), method(m)
+	{};
+	PdfContentOperator(){};
+};
+
+struct PdfContentEngine
+{
+	std::map knownOps;
+	void registerOperator(PdfContentOperator op)
+	{
+		knownOps[op.key] = op;
+	};
+	int process(std::string pdfOp, std::stack opStack)
+	{
+		bool isSupported = false;
+		std::map::iterator it = knownOps.begin();
+		while(it != knownOps.end())
+		{
+			if(!pdfOp.compare(it->first))
+			{
+isSupported = true;
+break;
+			}
+			++it;
+		}
+		
+		if( !isSupported )
+			return 0;
+		
+		{
+			void (*m)(std::stack) = knownOps[pdfOp].method;
+			m(opStack);
+		}
+		return knownOps[pdfOp].num_args;
+	};
+	
+};
+
 static bool print_output = false;
 
+void moveTo(std::stack stack)
+{
+	double dPosY = stack.top().GetReal();
+	stack.pop();
+	double dPosX = stack.top().GetReal();
+	stack.pop();
+	std::cout << string ( 12,' ' ) << " MoveTo: " << dPosX << " " << dPosY << std::endl;
+}
+
+void lineTo ( std::stack  stack)
+{
+	double dPosY = stack.top().GetReal();
+	stack.pop();
+	double dPosX = stack.top().GetReal();
+	stack.pop();
+	std::cout << string ( 12,' ' ) << " LineTo: " << dPosX << " " << dPosY << std::endl;
+}
+
+void concatenateMatrix(std::stack  stack)
+{
+	double a = stack.top().GetReal();
+	stack.pop();
+	double b = stack.top().GetReal();
+	stack.pop();
+	double c = stack.top().GetReal();
+	stack.pop();
+	double d = stack.top().GetReal();
+	stack.pop();
+	double e = stack.top().GetReal();
+	stack.pop();
+	double f = stack.top().GetReal();
+	stack.pop();
+	std::cout << string ( 12,' ' ) << " ConcatMatrix: " << a << " " << b <<" " << c << " " << d <<" " << e << " " << f < stack;
 
+
+
 while( pTokenizer->ReadNext( eType, pszToken, var ) )
 {
 if( eType == ePdfContentsType_Keyword )
@@ -32,25 +123,10 @@
 if (print_output) std::cout << setw(12) << (numKeywords+numVariants)
 << " Keyword: " << pszToken << std::endl;
 
-// support 'l' and 'm' tokens
-if( strcmp( pszToken, "l" ) == 0 ) 
-{
-double dPosY = stack.top().GetReal();
-stack.pop();
-double dPosX = stack.top().GetReal();
-stack.pop();
-
-if(print_output) std::cout << string(12,' ') << " LineTo: " << dPosX << " " << dPosY << std::endl;
-}
-else if( strcmp( pszToken, "m" ) == 0 ) 
-{
-double dPosY = stack.top().GetReal();
-stack.pop();
-double dPosX = stack.top().GetReal();
-stack.pop();
-
-if(print_output) std::cout << string(12,' ') << " MoveTo: " << dPosX << " " << dPosY << std::endl;
-}
+	int usedArgs = engine.process(pszToken, stack);
+	for(int i = 0; i < usedArgs; ++i)
+		stack.pop();
+	
 }
 else if ( eType == ePdfContentsType_Variant )
 {
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Parsing content streams

2007-11-08 Thread Pierre Marchand
Le Thursday 08 November 2007 11:08:14 Craig Ringer, vous avez écrit :
> I've put together a quick reader based on Dom's code that can be used to
> read a content stream an operator at a time, returning a pair containing
> the string representation of the operator and a vector of PdfVariant
> operands. There's also a simple function to accumulate the lot of them
> if you want to read a whole stream at once.

Does it mean that with a PdfOperator wrapper class which could register 
methods to do actual job, a renderer could be written incrementally and more 
or less easily ?

-- 
Pierre Marchand

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] Setting a Crop Box

2007-10-23 Thread Pierre Marchand
Le Tuesday 23 October 2007 17:30:14 Jonathan Sibony, vous avez écrit :
> Hello,
>
> How do I set a Crop Box? (any painting will take place from that point
> only within the new clipping path).
> I see the PdfPage has a GetCropBox(), but how do I set one myself?
>
> Thanks in advance
> jonathan

extracted from podofoimpose.cpp
==
PdfObject trimbox;
PdfRect trim(extraSpace, extraSpace, destWidth, destHeight);
trim.ToVariant(trimbox);
PdfPage * newpage = targetDoc->CreatePage ( PdfRect ( 0.0, 0.0, pw, ph ) );
newpage->GetObject()->GetDictionary().AddKey( PdfName("TrimBox"), trimbox);
======
Would be the same for any box.
-- 
Pierre Marchand

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] DeletePages

2007-09-28 Thread Pierre Marchand
Hi,
It seems difficult to remove pages from this doc*.
I fixed some segfaults but can't figure out where, exactly, lies the problem.

* http://www.gutenberg.eu.org/pub/GUTenberg/publicationsPDF/26-bouche.pdf
-- 
Pierre Marchand
Index: src/PdfPagesTree.cpp
===
--- src/PdfPagesTree.cpp	(révision 670)
+++ src/PdfPagesTree.cpp	(copie de travail)
@@ -387,8 +387,16 @@
 thePageObj->GetDictionary().RemoveKey( PdfName( "Parent" ) );
 
 PdfObject* theKidsArray = GetKids( theParentPagesDict ) ;
-PdfArray& kArr = theKidsArray->GetArray();
-kArr.erase( kArr.begin() + theIndexInKidsArray );
+	if(NULL != theKidsArray)
+	{
+PdfArray& kArr = theKidsArray->GetArray();
+kArr.erase( kArr.begin() + theIndexInKidsArray );
+	}
+	else
+	{
+		PdfError::DebugMessage( "Cannot find kids array where I'm supposed to be referenced\n");
+		PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );
+	}
 }
 else if( !isPageALeaf )
 {
@@ -400,7 +408,14 @@
 PdfObject& oneChild = kArr[0];
 int	indexInKArr = GetPosInKids( thePageObj );
 PdfObject* theKidsArray = GetKids( theParentPagesDict );
-oneChild.GetDictionary().AddKey( PdfName( "Parent" ), theParentPagesDict );
+		if(oneChild.IsDictionary())
+oneChild.GetDictionary().AddKey( PdfName( "Parent" ), theParentPagesDict );
+		else if(oneChild.IsReference())
+		{
+		PdfObject* oneChildInd = theParentPagesDict->GetOwner()->GetObject(oneChild.GetReference());
+		oneChildInd->GetDictionary().AddKey( PdfName( "Parent" ), theParentPagesDict );
+		}
+		
 theKidsArray->GetArray()[ indexInKArr ] = oneChild;
 }
 }
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] GetResources

2007-09-21 Thread Pierre Marchand
Can I expect  PdfPage::GetResources() to return inherited resources ?

Case yes, it does not here and something like 
page->GetResources()->GetDictionary() segfaults with a PDF generated by 
Scribus 1.3.3.10 which put resources in "/Pages". Although 
page->GetResources() does not but indeed returns 0.

Case no, is there a "best" way to inspect inheritance tree ?

-- 
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] [Podofo-svn] SF.net SVN: podofo: [650] podofo/trunk

2007-09-21 Thread Pierre Marchand
oups, I sent  the wrong diff. Here is the good.
-- 
Pierre Marchand
Index: tools/podofoimpose/pdftranslator.cpp
===
--- tools/podofoimpose/pdftranslator.cpp	(révision 651)
+++ tools/podofoimpose/pdftranslator.cpp	(copie de travail)
@@ -73,6 +73,24 @@
 return true;
 }
 
+bool PdfTranslator::checkIsPDF(std::string path)
+{
+	ifstream in ( path.c_str(), ifstream::in );
+	if (!in.good())
+		throw runtime_error("setSource() failed to open input file");
+	
+	const int magicBufferLen = 5;
+	char magicBuffer[magicBufferLen ];
+	in.read(magicBuffer, magicBufferLen );
+	std::string magic( magicBuffer , magicBufferLen  );
+	
+	in.close();
+	if(magic.find("%PDF") < 5)
+		return true;
+	
+	return false;
+}
+
 PdfTranslator::PdfTranslator(double sp)
 {
 sourceDoc = 0;
@@ -82,24 +100,19 @@
 
 void PdfTranslator::setSource ( const std::string & source )
 {
-	ifstream in ( source.c_str(), ifstream::in );
-	if (!in.good())
-		throw runtime_error("setSource() failed to open input file");
 	
-const int magicBufferLen = 5;
-char magicBuffer[magicBufferLen ];
-in.read(magicBuffer, magicBufferLen );
-std::string magic( magicBuffer , magicBufferLen  );
-	
-	if(magic.find("%PDF") < 5)//it is a PDF file (I hope)
+	if(checkIsPDF(source))
 	{
-		in.close();
 		inFilePath = source;
 		sourceDoc = new PdfMemDocument ( inFilePath.c_str() ); // must succeed or throw
 	}
 	else // it has to be a list of PDF files
 	{
-		in.seekg(0);
+		
+		ifstream in ( source.c_str(), ifstream::in );
+		if (!in.good())
+			throw runtime_error("setSource() failed to open input file");
+		
 		std::vector fileList;
 		char *filenameBuffer = new char[1000];
 		do
@@ -125,6 +138,7 @@
 			multiSource.push_back(*ms);
 			}
 		}
+		delete filenameBuffer;
 	}
 }
 
Index: tools/podofoimpose/pdftranslator.h
===
--- tools/podofoimpose/pdftranslator.h	(révision 651)
+++ tools/podofoimpose/pdftranslator.h	(copie de travail)
@@ -85,6 +85,7 @@
 double destHeight;
 int maxPageDest;
 
+	bool checkIsPDF(std::string path);
 void drawLine(double x, double y, double xx, double yy, std::ostringstream & a );
 void signature(double x , double y, int sheet, const std::vector & pages, std::ostringstream & a );
 	int pageRange(int plan, int sheet , int pagesInBooklet, int numBooklet); // much more a macro !
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] [Podofo-svn] SF.net SVN: podofo: [650] podofo/trunk

2007-09-21 Thread Pierre Marchand

> Is there any static method or even global function in podofo's public API
> that check if a file is a PDF one ?

I made one that conflicts with the last commit.
-- 
Pierre Marchand
Index: tools/podofoimpose/pdftranslator.cpp
===
--- tools/podofoimpose/pdftranslator.cpp	(révision 651)
+++ tools/podofoimpose/pdftranslator.cpp	(copie de travail)
@@ -73,6 +73,23 @@
 return true;
 }
 
+bool PdfTranslator::checkIsPDF(std::string path)
+{
+	ifstream in ( path.c_str(), ifstream::in );
+	if (!in.good())
+		throw runtime_error("setSource() failed to open input file");
+	
+	const int magicBufferLen = 5;
+	char magicBuffer[magicBufferLen ];
+	in.read(magicBuffer, magicBufferLen );
+	std::string magic( magicBuffer , magicBufferLen  );
+	
+	if(magic.find("%PDF") < 5)
+		return true;
+	
+	return false;
+}
+
 PdfTranslator::PdfTranslator(double sp)
 {
 sourceDoc = 0;
@@ -82,16 +99,7 @@
 
 void PdfTranslator::setSource ( const std::string & source )
 {
-	ifstream in ( source.c_str(), ifstream::in );
-	if (!in.good())
-		throw runtime_error("setSource() failed to open input file");
-	
-const int magicBufferLen = 5;
-char magicBuffer[magicBufferLen ];
-in.read(magicBuffer, magicBufferLen );
-std::string magic( magicBuffer , magicBufferLen  );
-	
-	if(magic.find("%PDF") < 5)//it is a PDF file (I hope)
+	if(checkIsPDF(source))
 	{
 		in.close();
 		inFilePath = source;
Index: tools/podofoimpose/pdftranslator.h
===
--- tools/podofoimpose/pdftranslator.h	(révision 651)
+++ tools/podofoimpose/pdftranslator.h	(copie de travail)
@@ -85,6 +85,7 @@
 double destHeight;
 int maxPageDest;
 
+	bool checkIsPDF(std::string path);
 void drawLine(double x, double y, double xx, double yy, std::ostringstream & a );
 void signature(double x , double y, int sheet, const std::vector & pages, std::ostringstream & a );
 	int pageRange(int plan, int sheet , int pagesInBooklet, int numBooklet); // much more a macro !
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] [Podofo-svn] SF.net SVN: podofo: [650] podofo/trunk

2007-09-21 Thread Pierre Marchand
Le jeudi 20 septembre 2007 21:34, Craig Ringer a écrit :
> > Modified: podofo/trunk/tools/podofoimpose/pdftranslator.cpp
> > ===
> > --- podofo/trunk/tools/podofoimpose/pdftranslator.cpp   2007-09-19 
> > 15:19:00
> > UTC (rev 649) +++
> > podofo/trunk/tools/podofoimpose/pdftranslator.cpp   2007-09-20 15:48:24 UTC
> > (rev 650) @@ -85,10 +85,62 @@
> >
> >  void PdfTranslator::setSource ( const std::string & source )
> >  {
> > -inFilePath = source;
> > -sourceDoc = new PdfMemDocument ( inFilePath.c_str() ); // must
> > succeed or throw +  ifstream in ( source.c_str(), ifstream::in );
> > +   if (!in.good())
> > +   throw runtime_error("setSource() failed to open input file");
> > +
> > +   char *magicBuffer = new char [5];
> > +   in.read(magicBuffer, 5);
> > +   std::string magic( magicBuffer , 5 );
>
> This is a memory leak, as magicBuffer is never freed. It's not a big
> issue but should be fixed. Eliminating the dynamic memory allocation in
> favour of a stack-based static buffer would be preferable - overrun is
> not a risk since read() checks length limits.

Is there any static method or even global function in podofo's public API that 
check if a file is a PDF one ?

--
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] [Podofo-svn] SF.net SVN: podofo: [650] podofo/trunk

2007-09-21 Thread Pierre Marchand
Le jeudi 20 septembre 2007 21:34, Craig Ringer a écrit :
> This is a memory leak, as magicBuffer is never freed. It's not a big
> issue but should be fixed. Eliminating the dynamic memory allocation in
> favour of a stack-based static buffer would be preferable - overrun is
> not a risk since read() checks length limits.

It seems that's time to me to learn programming!
I have to admit that I think first (only?) about features. I'll do my best to 
not forget that's now publicly available and have to be a bit more serious 
and maybe readable. 

-- 
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] podofoimpose

2007-09-20 Thread Pierre Marchand
I tried some things in it :
- take more than one file as input;
- compute some basic & well known imposition plans

-- 
Pierre Marchand
Index: tools/podofoimpose/pdftranslator.cpp
===
--- tools/podofoimpose/pdftranslator.cpp	(révision 649)
+++ tools/podofoimpose/pdftranslator.cpp	(copie de travail)
@@ -85,10 +85,62 @@
 
 void PdfTranslator::setSource ( const std::string & source )
 {
-inFilePath = source;
-sourceDoc = new PdfMemDocument ( inFilePath.c_str() ); // must succeed or throw
+	ifstream in ( source.c_str(), ifstream::in );
+	if (!in.good())
+		throw runtime_error("setSource() failed to open input file");
+	
+	char *magicBuffer = new char [5];
+	in.read(magicBuffer, 5);
+	std::string magic( magicBuffer , 5 );
+	
+	if(magic.find("%PDF") < 5)//it is a PDF file (I hope)
+	{
+		in.close();
+		inFilePath = source;
+		sourceDoc = new PdfMemDocument ( inFilePath.c_str() ); // must succeed or throw
+	}
+	else // it has to be a list of PDF files
+	{
+		in.seekg(0);
+		std::vector fileList;
+		char *filenameBuffer = new char[1000];
+		do
+		{
+			in.getline (filenameBuffer, 1000 );
+			fileList.push_back(std::string(filenameBuffer, in.gcount() ) );
+		}
+		while ( !in.eof() );
+		in.close();
+		bool first = true;
+		for(std::vector::const_iterator ms = fileList.begin(); ms != fileList.end(); ++ms)
+		{
+			if(first)
+			{
+inFilePath = *ms;
+sourceDoc = new PdfMemDocument ( inFilePath.c_str() );
+first = false;
+			}
+			else
+			{
+			PdfMemDocument mdoc((*ms).c_str());
+			targetDoc->InsertPages( mdoc, 0, mdoc.GetPageCount());
+			multiSource.push_back(*ms);
+			}
+		}
+	}
 }
 
+void PdfTranslator::addToSource( const std::string & source )
+{
+	if( !sourceDoc )
+		return;
+	
+	PdfMemDocument extraDoc(source.c_str());
+	sourceDoc->InsertPages( extraDoc, 0,  extraDoc.GetPageCount() );
+	multiSource.push_back(source);
+	
+}
+
 void PdfTranslator::setTarget ( const std::string & target )
 {
 if ( !sourceDoc )
@@ -96,6 +148,14 @@
 
 // DOCUMENT: Setting `targetDoc' to the input path will be confusing when reading the code.
 targetDoc = new PdfMemDocument ( inFilePath.c_str() );
+if(!multiSource.empty())
+{
+	for(std::vector::const_iterator ms = multiSource.begin(); ms != multiSource.end(); ++ms)
+	{
+		PdfMemDocument mdoc((*ms).c_str());
+		targetDoc->InsertPages( mdoc, 0, mdoc.GetPageCount());
+	}
+}
 outFilePath  = target;
 pcount = targetDoc->GetPageCount();
 
@@ -203,6 +263,120 @@
 while ( !in.eof() );
 }
 
+//returns the number of processed pages.
+int PdfTranslator::pageRange(int plan, int sheet, int pagesInBooklet, int numBooklet)
+{
+	double pw = sourceDoc->GetPage(0)->GetMediaBox().GetWidth();
+	double ph = sourceDoc->GetPage(0)->GetMediaBox().GetHeight();
+	if(plan == 4) // For now, it is the only "well known" plan ;-)
+	{
+		destWidth = pw * 2;
+		destHeight = ph * 2;
+		int firstpage = (plan * (sheet - 1) ) + 1 + ((numBooklet - 1) * pagesInBooklet);
+		int lastpage = (numBooklet * pagesInBooklet) - ((sheet-1) * plan);
+		{
+			PageRecord p;
+			//recto
+			p.sourcePage = firstpage;
+			p.destPage = sheet * 2 - 1;
+			p.rotate = 0;
+			p.transX = 1.0 * pw;
+			p.transY = 0.0;
+			planImposition.push_back(p);
+			
+			p.sourcePage = firstpage + 3;
+			p.destPage = sheet * 2- 1;
+			p.rotate = 180.0;
+			p.transX = 2.0 * pw;
+			p.transY = 2.0 * ph;
+			planImposition.push_back(p);
+			
+			p.sourcePage = lastpage - 3;
+			p.destPage = sheet * 2- 1;
+			p.rotate = 180.0;
+			p.transX = 1.0 * pw;
+			p.transY = 2.0 * ph;
+			planImposition.push_back(p);
+			
+			p.sourcePage = lastpage;
+			p.destPage = sheet * 2- 1;
+			p.rotate = 0.0;
+			p.transX = 0.0;
+			p.transY = 0.0;
+			planImposition.push_back(p);
+			
+			//verso
+			p.sourcePage = firstpage + 1;
+			p.destPage = sheet * 2 ;
+			p.rotate = 0;
+			p.transX = 0.0 ;
+			p.transY = 0.0;
+			planImposition.push_back(p);
+			
+			p.sourcePage = firstpage + 2;
+			p.destPage = sheet * 2 ;
+			p.rotate = 180.0;
+			p.transX = 1.0 * pw;
+			p.transY = 2.0 * ph;
+			planImposition.push_back(p);
+			
+			p.sourcePage = lastpage - 2;
+			p.destPage = sheet * 2;
+			p.rotate = 180.0;
+			p.transX = 2.0 * pw;
+			p.transY = 2.0 * ph;
+			planImposition.push_back(p);
+			
+			p.sourcePage = lastpage - 1;
+			p.destPage = sheet * 2 ;
+			p.rotate = 0.0;
+			p.transX = 1.0 * pw;
+			p.transY = 0.0;
+			planImposition.push_back(p);
+			
+			return 8;
+		} 
+	}
+}
+
+void PdfTranslator::computePlan(int wellKnownPlan, int sheetsPerBooklet)
+{
+	std::cerr << " computePlan(" <<  wellKnownPlan << ", "<GetPageCount() / pagesPerBooklet;
+//### 	have to deal with padding
+	int processedPages = 0;
+	int numBooklet = 1;
+	int nextBooklet = pagesPerBooklet;
+	int s = 1;
+	int p = 0;
+	while(processedPag

[Podofo-users] PdfPage returns a wrong TrimBox

2007-09-14 Thread Pierre Marchand
It works better with this change (I hope it breaks nothing):

Index: src/PdfRect.cpp
===
--- src/PdfRect.cpp (révision 636)
+++ src/PdfRect.cpp (copie de travail)
@@ -94,7 +94,7 @@
 m_dLeft   = inArray[0].GetReal();
 m_dBottom = inArray[1].GetReal();
 m_dWidth  = inArray[2].GetReal() - m_dLeft;
-m_dHeight = inArray[3].GetReal() + m_dBottom;
+m_dHeight = inArray[3].GetReal() - m_dBottom;
 }
 else
 {

-- 
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


[Podofo-users] About DeletePages()

2007-09-12 Thread Pierre Marchand
hi,
Would it be possible to really remove a page (or at least its content) from 
the page tree. Maybe with an extra arg like :
void PoDoFo::PdfMemDocument::DeletePages  ( int  inFirstPage,
int 
inNumPages,
bool 
remContent = fase)

Or just set a flag that tell  PdfWriter to not output some page, or something 
else you like much. Here, I get page content into XObject in order to reuse 
it for imposition. I wan't to do that in place to keep all resources easily 
available for these XObjects. At the end, I would like to remove xobjectised 
pages to avoid having each content stream twice.
-- 
Pierre Marchand

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users