Get Page Count of PDF using Publication Post Processing Plugin

Hi,
I am using the publiching functionality of BOXI 3.1 to create a large volume of PDFs.  I have a report that I am publishing using a publication with a post processing plugin applied after distribution.  I need to get the total page count of the pdf and store this value in the database.  Becuase I am already using a post processing plugin after distribution, it would be ideal to extract it there...but I cannot figure out how to get the value at this point. 
Currently we parse the actual binary pdf file, but I know that Crystal and BOXI know this total page count and some point in the processing cycle.  Does anyone know how to get at the total page count of each pdf/report instance?
Thanks,
Kristina

I would post-process the PDF file as you're doing.
The total page count isn't metadata - it's something computable from the report instance, that is lost after the PDF is generated.
Trying to work with that would lead to a more complex workflow - i.e., schedule to report format, open the report instance using a reporting SDK, calculate the total page count, export using the reporting SDK to PDF, add the PDF to the publication artifact and remove the report instance, other steps I may have missed....
Sincerely,
Ted Ueda

Similar Messages

  • How to get Page Count of pdf in Document library in EventHandler

    Hi,
    How to get Page Count of pdf in Document library once uploaded has been done and i would like to update the page count value in document library column of the corresponding file.
    I should achieve it in Event handler.
    Which even should i use, either ItemAdded or "ItemUpdated "?
    Thanks & Regards
    Poomani Sankaran.

    Hello,
    If you are looking for file download or view count then event handler will not work. You need to enable the analytic report to your site. Once you enable it then you can see the report within a browser or you can also create custom webpart to show count
    of specific file.
    http://blogs.msdn.com/b/ecm/archive/2010/05/03/web-analytics-in-sharepoint-2010-insights-into-reports-and-metrics.aspx
    http://sharepoint.stackexchange.com/questions/34611/count-of-files-under-a-folder-in-a-document-library
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Report.Services 2008 - get page-count or row-count in the c#-code

    hello
    is it possible to get from the ReportViewer-control / ServerReport the page-count or row-count after the
    reportViewerCheck.ServerReport.Refresh();
    statement ??
    many thanks in advance for any clue & regards
    Michael

    Hi Michael,
    Yes, you can get them. For row count, you can add a parameter to store the row count of your dataset in your report.
    Here are the steps:
    1.     Add 2 datasets in your report, one for report use and the other on is to row count use. For instance:
    DataSet1: SELECT     HumanResources.vEmployee.* FROM         HumanResources.vEmployee
    DataSet2: SELECT     COUNT(*) FROM         HumanResources.vEmployee
    2.     Add a parameter, set the parameter’s default value set to Get Values from a query and select DataSet2.
    Then, in your ASP.NET web application code you can use the following function to get the row count of the report:
    private int GetReportRowCount(ReportViewer report)
                return Convert.ToInt32(report.ServerReport.GetParameters()[0].Values[0].ToString());
    For page count, you can refer to the following code:
    private int GetReportPageCount(ReportViewer report)
                return report.ServerReport.GetTotalPages();
    You may not get the correct row count and page count in after executing Refresh () method, that’s because when you run this method, it will start another thread to refresh the report and the code below Refresh () method will not wait refreshing complete but run it. For instance, you may get the page count as o if you run the following code in the Button event:
    // Click this Button to refresh the ReportViewer1
            protected void btnGetPageCount_Click(object sender, EventArgs e)
                // Refresh the ReportViewer1
                this.ReportViewer1.ServerReport.Refresh();
                // Get ReportViewer1's page count and display in the txtPageCount TextBox
                this.txtPageCount.Text = this.ReportViewer1.ServerReport.GetTotalPages().ToString();
    You can run the refresh in separate events and get page count in another event, such as below code:
            // Click this Button to refresh the ReportViewer1
            protected void btnGetPageCount_Click(object sender, EventArgs e)
                // Refresh the ReportViewer1
                this.ReportViewer1.ServerReport.Refresh();
            // Display the txtPageCount's text to ReportViewer's page count
            protected void btnGetPageCount2_Click(object sender, EventArgs e)
                // Get ReportViewer1's page count and display in the txtPageCount TextBox
                this.txtPageCount.Text = this.ReportViewer1.ServerReport.GetTotalPages().ToString();
    Hope this helps! I would suggest you post a new thread in Visual Studio Report Controls forum if you need more help about using ReportViewer in ASP.NET web application.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • I am trying to delete a page from a pdf using Acrobat X Pro but the delete option is greyed out. Why

    I am trying to delete a page from a pdf using Acrobat X Pro but the delete option is greyed out.  Does anyone know why?

    Post your question in the forum for Adobe Acrobat.

  • How do I extract pages from a pdf using 'Adobe PDF Pack'?

    How do I extract pages from a pdf using 'Adobe PDF Pack'?

    I think you have to buy extractor for 1.99 a month to extract PDF.  But I am having trouble activating it.  Good luck.

  • How do I print just one page of a .pdf using the android e-Print app?

    How do I print just one page of a .pdf using the android e-Print app?

    Hello,
    I see that you're having an issue with printing just one page from the E-print app. 
    Unfortunately, on an android device, you do not have the feature to select how many pages you want to print 
    Thanks!

  • Preflight keeps saying  "Unable to save the PDF File after post processing"

    I'm at a loss how to overcome this. Spent almost a whole day, together with another person, trying to fix it with no success!
    I use Adobe pro CC on a PC
    I usually receive pdf files from this one client who edits and formats a book in Mac Pages. Up until a few days ago I had no problems converting the client's pdfs into pdf/x3, but the last three versions of the latest file have stumped me.
    Just to test, I first just tried to convert the file (33MB), unchanged, to pdf/x3 using the save as other option - message reads  "the document has been saved, however, it could not be converted according to the selected standard profile: convert to PDF/X. Please use preflight with the profile "Convert to PDF/X" in order to identify those properties of the document which prevent it from being compliant to this profile"
    if I then choose under Profiles - convert to PDF/X3 - it says no problems found, and appears to have saved the file. If I try to save again as a pdf/x3, just to make sure, it then tells me it's not pdf/x3 compliant
    OK - so then I go back to preflight - and choose the standards function - then pdf/x3, then continue with the default colour profile. About halfway through the conversion, at the point of saving the file,  I get the message "unable to save the pdf file after post processing"
    So far I've had no luck figuring out what this is.
    I then choose the option of "verify compliance of ppdf/x3" - message reads "pdf/x3 version key (GTS_PDFXVersion) missing", and "Trapped key not true or false"
    Help!! How can I be sure the file converted / or not?
    kim

    Yes I was/am aware of Preflight's inability to play nicely over cloud technologies in certain cases, especially wrt Standards technologies, this will be partially addressed in an upcoming version of Preflight without saying too much.  But the same thing could theoretically have happened if the file was also located on another local network client or server.  Leaving aside the argument that this may violate the Acrobat User Agreement - since purchasing the software, the user agrees to employ its functionality on a single host system and precludes host-client-based scenarios - this simply is not a supported use, meaning the user may not have expectations that it will work at all, if the applications requirements are not observed.  There do exist server-solutions for Preflight files within networks, but Acrobat and by extension Acrobat Preflight is not one of those solutions, and (still) belongs in the single host-based desktop environment.
    However most (99.9%) functions within Acrobat <-> acrobat.com file exchange are supported, file syncing across multiple devices will soon be supported, but Standards compliance is still admittedly a problem at this point.  Some testing has been done using 3rd party cloud technologies starting with enterprise-based solutions, such as Office 365, and this will continue to ramp up to include other 3rd party products.
    As for the second point, Preflight will usually change the PDF version to be complaint, are you saying that it was unable to do so in this case?  It seems that this error should have popped up during the normal Preflight conversion attempt.  Personally I think solving a workflow problem using the print path is a little bit of a heavy-handed approach, but if helped and the results are acceptable, then that is good.  Since that path is non-existent on a Mac, as one needs to Save as Adobe PDF from the Print dialog's PDF drop-down menu, I am assuming your workflow involved file creation on a Mac, then further processing on Windows using the PDF printer.  I am wondering if a simple resave/Save As... to PDF with overwrite on a Mac, or Preflighting the file using a PDF version compatibility profile before the PDF/X conversion would have helped.  Since there are such a multitude of methods that a PDF can be created, there are also many ways within Acrobat that a user can shape the file to be compatible with the expected workflow, ie, 'many ways to skin a cat', without being morbid.

  • Getting Page Count for a Multi-Page PDF file using Illustrator script?

    Does anyone know how to get the page count of a multi page PDF file?  I know you can then open each page using the PDFFileOptions (pagetoopen).  But I need to know up front how many pages there are to loop thru to open each page and process each page.
    Any Ideas?

    This script i did for photoshop:
    OK so lets do it working on WIN and MAC without any shell script.
    This solution is not the best but its working.
    I used Try catch to solve it.
    Only issue is that you should at least somehow know how many pages you expect in pdf.. this mean if you are working with books or flyers...
    Then set the maxPagesCount to that number.
    I am working with pdfs with max 20pages.. so i start open the 20 then 19 then 18 and when i am success i know the amount of pages.
    Its not the quicker way but its usable.
    var maxPagesCount = 20;
    var actPagesCount = maxPagesCount;
    var opts1 = new PDFOpenOptions();
    opts1.usePageNumber = true;
    opts1.antiAlias = true;
    opts1.bitsPerChannel = BitsPerChannelType.EIGHT;
    opts1.resolution = 10; //it will load faster the test page
    opts1.suppressWarnings = true;
    opts1.cropPage = CropToType.MEDIABOX;
    myFunction = function () {
      try { 
          app.displayDialogs = DialogModes.NO;
          var fileList = openDialog();
          for (i = 0; i < fileList.length; i++) {
            actPagesCount = maxPagesCount;
            getPagesCount(fileList[i],maxPagesCount);
            alert(actPagesCount);
      } catch (exception) { 
        alert(exception);
    getPagesCount = function (checkFile, lastPageID) {
      try {          
        for (var checkPage = lastPageID; checkPage > 0; checkPage--) {
          opts1.page = checkPage;                    
          var docRef = open(checkFile, opts1, false);                  
          docRef.close(SaveOptions.DONOTSAVECHANGES);                  
          actPagesCount = lastPageID;                  
          return;                  
          checkPage=0;                              
      } catch (exception) {
        // Look for next page        
        checkPage--;        
        getPagesCount(checkFile,checkPage);

  • How to add page count of PDF to the file name?

    I need help with an applescript that can look at a pdf, determine the page count in file and then add that value to the end of the file name in front of the .pdf
    ex.
    original name "map with pages4c.pdf"
    renamed "map with pages4c_48.pdf"
    Any help would be appreciated or suggestions on how this could be done.
    Thanks,
    John

    Hello
    That's quite simple.
    Just replace this chunk of code -
    tell application "Finder"
    set n to f's name
    set f's name to (n's text 1 thru -5) & "_" & p & ".pdf"
    end tell
    with -
    if 10 > p then set p to "0" & p
    tell application "Finder"
    set n to f's name
    set f's name to (n's text 1 thru -5) & "_" & p & ".pdf"
    end tell
    By the way, if there are 10000 files in directory tree, I'm afraid Finder is too slow to get files list. In order to avoid Apple Events timeout error, at least, replace this line -
    tell o to run
    with -
    with timeout of 3600 seconds
    tell o to run
    end timeout
    Or try the following script, which employs find(1) instead of Finder to get files list.
    All the best,
    Hiroto
    --SCRIPT3
    on run
    --main((choose folder with multiple selections allowed) as list)
    main((choose folder) as list)
    end run
    on open aa
    main(aa)
    end open
    on main(aa)
    (* list aa : list of folder aliases *)
    script o
    property ff : {}
    -- confirmation for safety
    set AppleScript's text item delimiters to {ASCII character 0}
    set aa to (aa as Unicode text)'s text items
    set AppleScript's text item delimiters to {""}
    set aa to (choose from list aa default items aa ¬
    with prompt ("You're renaming pdf files in following folder tree(s).") ¬
    with multiple selections allowed)
    if aa = false then error number -128
    -- process each folder
    set k to 0
    repeat with a in aa
    set a to a as alias
    -- get pdf files' POSIX path list (= ff)
    set ff to {}
    set sh to "find " & quoted form of POSIX path of a & " -type f -name \"*.pdf\" -print"
    try
    set t to (do shell script sh)
    on error
    set t to ""
    end try
    set px to count t's paragraphs
    set p0 to 1
    repeat -- in order to avoid stack overflow in getting large number of paragraphs at once
    set p1 to p0 + 3500
    if p1 ≥ px then set p1 to -1
    set ff to my ff & t's paragraphs p0 thru p1
    if p1 = -1 then exit repeat
    set p0 to p1 + 1
    end repeat
    if ff = {""} then set ff to {}
    -- process each pdf file
    repeat with f in my ff
    set f to f as POSIX file as alias
    tell application "Adobe Acrobat 7.0 Professional"
    --open f
    open f with invisible
    tell document 1
    set p to count pages
    close
    end tell
    end tell
    if 10 > p then set p to "0" & p
    tell application "Finder"
    set n to f's name
    set f's name to (n's text 1 thru -5) & "_" & p & ".pdf"
    end tell
    set k to k + 1
    end repeat
    end repeat
    -- decent notice
    tell application (path to frontmost application as string)
    display dialog ("Total of " & k & " pdf file(s) renamed successfully.") ¬
    with icon 1 giving up after 5
    end tell
    end script
    with timeout of 3600 seconds -- just in case
    tell o to run
    end timeout
    end main
    --END OF SCRIPT3
    Message was edited by: Hiroto (fixed typos)

  • How to markup a layout so each area is exported as a different page on the pdf using the crop and bleeds

    Hi, I work in the sign industry and I am looking at a way to streamline our preprint setup for artworks
    the issue is that we will get an artwork that is 6m x 2m. This is to big to do in one print so we will chop it into 2-3 pieces and then print those.
    this is currently done by laying out the full artwork in indesign then exporting it as a pdf. this pdf is then imported into illustrator where we will manually cutup the artwork using clipping masks (it has to be manual due to cuts in the artwork needing to managed so it doesn't go though text, ext).
    ideally I would like to lay it out in indesign then markup this layout with boxes which show the areas to be cut out. then we I export I'd like indesign to export each box as its own pdf(or pages in one pdf) with cut marks and bleeds.
    is this possible in indesign using say the slice tool? (the slice tool seems to be for html elements)
    any help or suggest would be most welcome
    Kind regards
    Gareth

    Hello gareth, not sure if the info' below will be of use, but I will give it a go.
    Try this…
    (I am using Indesign CS5.5)
    1. Create your desired page size.
    2. Then create 2 or 3 more pages
    3. Open the pages window (from top menu - window - pages)
    4. (fig 1) From the pages menu click top right down arrow to get the menu and uncheck ‘Allow Document Pages to Shuffle’.
    5. (fig 2) From the pages menu, drag page 2 and 3 next to page 1, see fig 3 for result.
    6. (fig 4) Place text/image across the pages you have created then save as a Pdf.

  • Getting Page count with AppleScript

    Hi Everyone,
    It been a long time since I visited so I hope everyone is well.
    Does anyone know how to get the page count of a document with Applescript. The best I've done is to divide the total number of words by the average amount of words on a page. This isn't perfect but it give me something close. I'm using the following snippets to get the info, which is being used to popular real time statitics about the progress of book four on my website.
    set WordCount to word count
    set ParagraphCount to paragraph count
    set PageCount to round (WordCount / 184)
    set CharacterCount to character count
    Paragraph count doesn't seem to come too close either. I think it just adds up the number of carridge returns in the document.
    Cheers
    Chris
    http://www.thomasstrange.com

    <pre>tell application "Pages"
    tell document 1
    page count
    end tell
    end tell</pre>
    For me, the result matches the actual number of pages.
    As for paragraph count, I assume you want to skip empty paragraphs.
    The obvious "length of paragraph 1" doesn't seem to work, so here's a less than optimal solution:
    <pre>tell application "Pages"
    tell document 1
    tell body text
    set paragraphCount to 0
    repeat with aParagraph in every paragraph
    if length of (contents of aParagraph as text) > 1 then
    set paragraphCount to paragraphCount + 1
    end if
    end repeat
    end tell
    end tell
    end tell
    paragraphCount</pre>
    Titanium PowerBook   Mac OS X (10.4.10)  

  • How to get image properties in PDF using javascript or plug ins

    Hi
    How to get the image(all the images) properties in PDF using javascript or suggest plug ins
    Thanks in Advance

    HI,
    In the PDF Edit API's ( as has already been suggested) there is the PDEImage and using this you should be able to find out everything you need to know about any image in a PDF file.
    I would recommend starting with PDEImageGetAttrs
    Hope this helps
    Malcolm

  • How to get image properties in PDF using javascript

    Hi
    How to get the image(all the images) properties in PDF using javascript?
    Thanks in Advance

    Hi
    Thanks for your quick response. Any recommended plug ins
    Thanks in advance

  • Deleting pages from a PDF using Acrobat X Pro

    Hello, I need to delete some pages from a PDF.  Within the same document, I can delete some pages with no issue, but can't delete other pages.  Why not?

    Well, now it's not happening. Figures...  Thank you for responding.  If it happens again, I will write again.

  • Adding Page Number in PDF using VBA

    Hi,
    I need to add page numbers to around 8000 PDF files via excel VBA. I would need to do this every month. I am new to VBA coding but I can manage to write a decent code. It would be great if any one of you would share a VBA code that would allow me to add page numbers to PDF files. I have Adobe professional 6.0.
    This is kind URGENT. All help will be welcome !!!
    Thanks

    Hi Vivek,
    Could you please test the following solutions to resolve the issue.
    Solution1:
    To display the page numbers from the first according to the section details i.e based on the number of sections in a report.
    example: If a report has3 sctions and first section comes in 3 pages,2nd section comes in 4 pages and 3rd section in 2 pages, then total number of pages is9. Then the display of page numbers should be [page number of section in(1,2or3)/total number of pages in all the sections]
      Insert a cell within a page and insert the formula
    =Concatenation("Page"" " ,PageInSection(1)" ")
    If the above doesnu2019t works then please try the following solution.
    Solution2:
    --Create a report with section.
    --Format the Section to "Start on a new page"
    --Apply Page Layout to the report
    --Insert a Cell and apply function  PageInSection()
    I hope this will help you.
    Regards,
    Deepti Bajpai

Maybe you are looking for

  • Memory Low

    Hello All, All our consultants are facing problem in login or while printing the sales order, billing document. It is throwing an error "STORAGE_PARAMETERS_WRONG_SET". Our operating system is 32-bit and windows server 2003. Previously we had 4GB of R

  • Report Print Order

    Post Author: gsrk CA Forum: General I am creating a Pack Slip using a crystal repot and i am running in to a problem in the Print Order.  I've created a simple report to show a carton items for a shipment and the report is grouped by carton ID (datat

  • SetUncaughtExceptionHandler() not working

    Hi there, using java 1.5... and using setDefaultUncaughtExcepion!handler() and setUncaughtExceptionHandler() to trap all uncaught exception in my (big) program. I'm observing that my 2 handlers are correctly called when a uncaught exception happens..

  • Only render an Item if the Item is not null

    I have a number of Items that have a Source Type of Database Column and are populated using an Automatic Row Fetch. My problem is that I want to only render them if they are not null. I have tried to use the condition - Value of Item in Expression 1

  • My portal DAD is down even after all correct properties are set.

    Hi, could any one update my question why the DAD is down (checked from OEM console) even after the properties set are correct? is there a way to troubleshoot it? I would be thankfull if I could get the answer/How to trouble shoot it? Thanks, Vijay.