On Mon, Jul 07, 2008 at 07:37:56PM +0300, Igor Stirbu wrote:
> Hello Michal,
> 
> 2008/7/7 Michal Hocko <[EMAIL PROTECTED]>:
> > On Mon, Jul 07, 2008 at 11:20:10AM +0300, Igor Stirbu wrote:
> > Seems like document is read only. Are you sure that document is _not_
> > linearized? Please note that manipulation with linearized document is
> > not supported. You have to delinearize it before you can edit it.
> 
> I've delinearized the document before running that script. 

Just to be sure - you have tried to delinearize document and used
delinearized one (note that it is different one than the original) and
you still get read-only exception?

> I tried to write a script without using the application but it seems
> that it works better if integrated. In case you know how to fix that
> script, please explain.
 
What do you mean by "using the application"? Your patch which integrates
that into the dialog rather than script which is run from gui without
dialog?

However your script:
> function zoom()
> {
>       f = loadPdf("/home/istirbu/test.pdf");
>       pg = f.getFirstPage();
>       for(; f.hasNextPage(pg); pg = f.getNextPage(pg))
>       {
>               pg.setTransformMatrix([1.3,0,0,1.3,-90,-115]);
>       }
>       f.unloadPdf();
> }

doesn't work properly in some cases:
* if document has only one page, for loop doesn't perform at all
  (because 1st page doesn't have any next page).
        - I would suggest simpler 
                for (i=f.getPage(1); i<= f.getPageCount(); ++i)

        - or do {} while(f.hasNextPage) if you insist on iterator
          approach
* I am also not sure whether unloadPdf saves changes
  (src/gui/qspdf.cc:65 says that CPdf instance is simply dropped thus
  no changes are saved - but I maybe I am missing something from
  scripting POV).
        - I would call f.save() before f.unloadPdf()

> Thanks,
> Igor
> 
> -- 
> :wq
-- 
Michal Hocko

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Pdfedit-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdfedit-support

Reply via email to