Ecrion Software Inc. Homepage
Forum Home Forum Home > XF Rendering Server > Generic Support
  New Posts New Posts RSS Feed: Engine.GetPageCount()
  FAQ FAQ  Forum Search   Register Register  Login Login

Engine.GetPageCount()

 Post Reply Post Reply
Author
Message / View First Unread Post
mattucg View Drop Down
Newbie
Newbie
Avatar

Joined: 28 Sep 2010
Posts: 32
Post Options Post Options   Quote mattucg Quote  Post ReplyReply Direct Link To This Post Topic: Engine.GetPageCount()
    Posted: 19 Oct 2010 at 3:42pm

When using Engine.Render(), followed by Engine.GetPageCount(), I am getting mixed results.

When the input file is XML and I use template to generate a PDF, the correct number of pages added to the merge context is returned. When the input file is PDF, 0 is returned, regardless of that file's length.
 
Any ideas?
Back to Top
gabig View Drop Down
Admin Group
Admin Group


Joined: 06 Aug 2008
Posts: 144
Post Options Post Options   Quote gabig Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 2010 at 9:00am
Hello,

Try adding all your inputs to a DAL job. You should get the right page count. Also, if you pass null as input, you will get the page count of the last rendering operation.

Regards,
Gabi
Back to Top
mattucg View Drop Down
Newbie
Newbie
Avatar

Joined: 28 Sep 2010
Posts: 32
Post Options Post Options   Quote mattucg Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 2010 at 12:25pm

I'm still having problems. Could you explain what you mean by pass null as input? I tried the following:

 

Engine eng = new Engine();

RenderingParameters param = new RenderingParameters();

param.MergeContextID = Engine.GetNewMergeContextID();

param.InputFormat = Engine.InputFormat.PDF;

param.OutputFormat = Engine.OutputFormat.PDF;

Stream inStm = new FileStream(@"C:\Docs\treason.pdf", FileMode.Open, FileAccess.Read);

Stream outStm = new FileStream(@"C:\Dev\Ecrion\merge.pdf", FileMode.Create, FileAccess.Write);

eng.Render(inStm, outStm, param);

int pgCount = eng.GetPageCount(null, null);

Back to Top
najarTheKing View Drop Down
Newbie
Newbie
Avatar

Joined: 11 Jan 2012
Location: KC
Posts: 1
Post Options Post Options   Quote najarTheKing Quote  Post ReplyReply Direct Link To This Post Posted: 11 Jan 2012 at 12:32pm
I'm having a similar problem where I get the following error when I do

Engine eng = new Engine();
eng.Render(inFile, outFile, param);

int pageCount = eng.GetPageCount(inFile, param);
// OR pageCount = eng.GetPageCount(inFile, null);

The error I get is:

java.lang.Exception: Server exception occured: An unreachable code exception has occurred.


Back to Top
radup View Drop Down
Admin Group
Admin Group
Avatar
Adminstrator

Joined: 19 May 2008
Posts: 83
Post Options Post Options   Quote radup Quote  Post ReplyReply Direct Link To This Post Posted: 17 Jan 2012 at 10:25am
Hi najarTheKing,

Please send us an email to support@ecrion.com along with XF Rendering Server version, build number and log file.

Regards,
Radu

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz

This page was generated in 0.078 seconds.