PDFedit Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000291 [GUI] =Other (GUI)= major always 02-21-09 22:00 02-27-09 11:41
Reporter Eric Doviak View Status public  
Assigned To hockm0bm
Priority normal Resolution fixed  
Status resolved  
Summary 0000291: "Set page transformation matrix" across a range of pages does not work properly
Description One of the great new features in PDFEdit 0.4.2 is its ability to apply "Edit page metrics" and "Set page transformation matrix" across a range of pages.

When I attempt to set the transformation matrix on all (or a large share) of the pages of a 30 page document however, PDFEdit sets the transformation matrix of one or two pages (sometimes three pages) and then stops.

For comparison, "Edit page metrics" across a range of pages *does* work properly.

I'm not sure if this is a general bug or if it only affects users of old hardware (like me). Fortunately, it doesn't crash the program, but it is annoying because almost every page must be set manually.

Thank you for all of the great work you have done. It is greatly appreciated.

Sincerely,
- Eric Doviak
Additional Information
Attached Files  Meckl-Zink_buggyPDF.tar.gz [^] (586,150 bytes) 02-22-09 19:09
 loury_1981_ORIGINAL.pdf [^] (567,654 bytes) 02-22-09 19:10
 loury_1981_RemovePages-EnlargePage.pdf [^] (617,874 bytes) 02-22-09 19:10
 loury_1981_RemovePages-EnlargePage-EnlargeText.pdf [^] (773,057 bytes) 02-22-09 19:11
 fix-ccpagecontets-lazy-ccs_parse.patch [^] (3,651 bytes) 02-26-09 12:59
 R_inferno.pdf [^] (670,495 bytes) 02-26-09 23:12
 R_inferno_resized.pdf [^] (958,922 bytes) 02-26-09 23:12

- Relationships

- Notes
(0000668)
hockm0bm
02-22-09 15:16

Hi,
does this happen for all of your files, or it happens only on some of them?
I have tried to apply all three options separately and also together on 30 pages on the pdf specification document (with 1236 pages in total) and everything worked as expected.
Could you upload a sample document?
 
(0000671)
Eric Doviak
02-22-09 19:24

Hi Michal,

I've uploaded some files that I was struggling with. It seems to happen with PDF files of academic articles that I download.

It may be helpful if you understand what I'm trying to do.

I'm writing a dissertation, so I frequently download PDF files with pages that are 5 inches by 8 inches (i.e. 12.7 cm by 20.32 cm). While they look nice on screen, the text is terribly small on the printed page and the printed page contains irritatingly large white margins, so I want to enlarge the page to 8.5 by 11 inches.

To do that in PDFEdit 0.4.2, I use "Edit page metrics" (to enlarge the page) and "Set page transformation matrix" (to enlarge the text). The names of the uploaded files reflect what I was trying to do.

You'll notice that some of the pages in the latter stage files are blank. I reported that bug in [GUI 0000295] ("Why are my pages disappearing?").

Thanks,
- Eric
 
(0000675)
hockm0bm
02-24-09 16:18

> To do that in PDFEdit 0.4.2, I use "Edit page metrics" (to enlarge the page)
> and "Set page transformation matrix" (to enlarge the text). The names of the
> uploaded files reflect what I was trying to do.

Could you name the precise parameters used for "Set page transformation matrix"?

Have you used only Set page metrics for loury_1981_RemovePages-EnlargePage.pdf ?
 
(0000676)
Eric Doviak
02-25-09 08:55

> Could you name the precise parameters used for "Set page transformation matrix"?

Short answer:

[ 1.25 , 0 , 0 , 1.25 , 0 , 0 ] for Meckl-Zink pages 1 thru 20
[ 1.15 , 0 , 0 , 1.15 , 0 , 0 ] for Loury pages 2 thru 26 (total: 25 pages)

Long answer:

In all cases, I'm trying to scale up to "letter" size paper (i.e. 8.5 in by 11 in = 612 pt by 792 pt). Since the original Loury pages were 466 pt by 693 pt, I wanted to increase them 115 percent. Since the original Meckl-Zink pages were 426 pt by 636 pt, I wanted to increase them 125 percent.

After typing in the page I want to scale and the number of pages I want to scale, I checked the "Scale Page" box in the "Set page transformation matrix" dialog box (and left the others unchecked). Then I went to the "Page Scaling" tab, where I entered 1.15 (for Loury) and 1.25 (for Meckl-Zink) and clicked "OK."

  
> Have you used only Set page metrics for loury_1981_RemovePages-EnlargePage.pdf ?

For that file, I first removed the first page and the last three pages (JStor junk), then I used the "Edit Page Metrics" utility.

Hope this helps,
- Eric
 
(0000687)
hockm0bm
02-25-09 18:21

I have tried this scenario with patches from 290 and 295 and still can reproduce the issue.
The problem is in some exception thrown after the first page is updated (as you can see in the embedded commandline:
> setPageTm()
Unknown exception in script occured
).
This happens also for other documents. I will look at this issue tomorrow.
 
(0000692)
Eric Doviak
02-26-09 05:53

> I have tried this scenario with patches from 290 and 295 and still can
> reproduce the issue.

Same here. Those patches allow me to set the page transformation matrix across all pages of the Meckl-Zink article, but I still have to fight with the Loury article.

You're making great progress though. I cannot tell you how much I appreciate your efforts.

Thank you so much,
- Eric
 
(0000696)
hockm0bm
02-26-09 10:34

Follow-up:
The exception is thrown during second call (read for second page) with the following trace:
-> QSPage::setTransformMatrix
  -> CPage::setTransformMatrix
    -> CPageDisplay::setTransformMatrix
      -> CPageContents::getContentStream

 247 CPageContents::getContentStream (size_t pos)
 248 {
 249 if (pos >= _ccs.size())
 250 >>>> throw CObjInvalidOperation ();

And from the above condition. Both pos and _ccs.size are 0. I don't have any idea, what is going on there and what is this check good for, but I can try to figure out.
 
(0000697)
hockm0bm
02-26-09 10:36

> I don't have any idea, what is going on there and what is this check good for,
> but I can try to figure out.

Ahh, I was too fast with the send button.
This simply means that there are no content streams for the page. The reason why is still not clear to me
 
(0000698)
hockm0bm
02-26-09 10:42

OK, it is starting to be more clear. I have tried a simple test where I have displayed a page, changed to the next in the row and returned back. Then I have tried to set transformation matrix for both pages and everything worked correctly.

This seems like a problem with lazy content stream parsing [the page display will forces parsing but the setTransformMatrix doesn't].
 
(0000699)
hockm0bm
02-26-09 11:02

Bang, here it is:

CPageContents initializes content streams with init method which has to be called whenever we want to access _ccs (container of all streams which form the content stream). This is done when we display page because we call the following chain:

-> PageViewS::showPage
  -> PageViewS::initializeWorkOperatorsInMode
    -> CPage::getContentStreams
      -> CPageContents::init
        -> CPageContents::parse

I am working on the patch
 
(0000700)
hockm0bm
02-26-09 13:00

Eric, could you try fix-ccpagecontets-lazy-ccs_parse.patch (on top of 2 patches from other bugs)?

I think that this should be the proper fix, but I have to discuss that with Jozo as this is not my code.
 
(0000705)
Eric Doviak
02-26-09 23:13

I just rebuilt PDFedit with the following patches:

  * crop_box-sync_with_media_box.patch
  * deep_copy_for_saving.patch
  * fix-ZlibFilterStreamWriter-supportObject.patch
  * fix-ccpagecontets-lazy-ccs_parse.patch

Then I downloaded Pat Burns' 103 page _The R Inferno_ (see uploads) and used the "Edit Page Metrics" and "Set Page Transformation Matrix" to resize it so that the text fills the page.

These patches worked like a charm!

I then sent all 103 pages to the office printer and now I have a beautiful book to read!

Thank you so much!
- Eric
 
(0000706)
hockm0bm
02-26-09 23:30

Good to here!

I will close this report as soon as the fix is in our CVS. This, however, can take some time because I would like to see comments from Jozo which is working on the another issue at the moment.
 
(0000707)
Eric Doviak
02-27-09 06:18

Back at home ... I installed the DEB containing those four patches and tested everything out on the Loury article and the Meckl-Zink article.

Everything works great!

Thanks,
- Eric
 
(0000708)
hockm0bm
02-27-09 11:41

The patch is in CVS

Eric, I am not sure when we're gonna push another release so it would be good to push all patches you have tested to the Debian maintainer of PDFedit
 

- Issue History
Date Modified Username Field Change
02-21-09 22:00 Eric Doviak New Issue
02-22-09 15:10 hockm0bm Status new => assigned
02-22-09 15:10 hockm0bm Assigned To  => hockm0bm
02-22-09 15:16 hockm0bm Note Added: 0000668
02-22-09 19:09 Eric Doviak File Added: Meckl-Zink_buggyPDF.tar.gz
02-22-09 19:10 Eric Doviak File Added: loury_1981_ORIGINAL.pdf
02-22-09 19:10 Eric Doviak File Added: loury_1981_RemovePages-EnlargePage.pdf
02-22-09 19:11 Eric Doviak File Added: loury_1981_RemovePages-EnlargePage-EnlargeText.pdf
02-22-09 19:24 Eric Doviak Note Added: 0000671
02-24-09 16:18 hockm0bm Note Added: 0000675
02-25-09 08:55 Eric Doviak Note Added: 0000676
02-25-09 18:21 hockm0bm Note Added: 0000687
02-26-09 05:53 Eric Doviak Note Added: 0000692
02-26-09 10:34 hockm0bm Note Added: 0000696
02-26-09 10:36 hockm0bm Note Added: 0000697
02-26-09 10:42 hockm0bm Note Added: 0000698
02-26-09 11:02 hockm0bm Note Added: 0000699
02-26-09 12:59 hockm0bm File Added: fix-ccpagecontets-lazy-ccs_parse.patch
02-26-09 13:00 hockm0bm Note Added: 0000700
02-26-09 23:12 Eric Doviak File Added: R_inferno.pdf
02-26-09 23:12 Eric Doviak File Added: R_inferno_resized.pdf
02-26-09 23:13 Eric Doviak Note Added: 0000705
02-26-09 23:30 hockm0bm Note Added: 0000706
02-27-09 06:18 Eric Doviak Note Added: 0000707
02-27-09 11:41 hockm0bm Status assigned => resolved
02-27-09 11:41 hockm0bm Resolution open => fixed
02-27-09 11:41 hockm0bm Note Added: 0000708