Printing selected pages

  • Hi,


    I've changed PDFView from version 2. to 3. and now I have a problem that print dialog does not allow printing selected pages (selection button is disabled)

    although some pages in document are selected:


    Code
    1. int pgcnt = wpView->command(COMPDF_PageSelectionCount);
    2. int ret = wpView->command(COMPDF_PrintDialog);
    3. // NOTE: pgcnt contains non zero value when some pages are selected

    I know that both v2 and v3 are outdated, but any kind of help would be appreciated.


    TIA

  • According to PDF documentation (WPViewPDF3.pdf), version should be 3.21.

    This year I'll move to version 4, but because of my company's policy it will take some time, so resolving problem with

    printing selection in version 3 is crucial.

  • I have two more questions:


    1. How come V2 supports this option in print dialog (selection radio button is enabled) and V3 doesn't (selection radio button is disabled)?

    2. Does V4 support printing selected pages through print dialog?

  • Thanks,


    I have added standard TPrintDialog and if selection radio-button is selected,

    I use: wpView->CommandStr(COMPDF_Print, SelectedPages);

    SelectedPages string contains selected pages.


    Now it works.


    However, when user prints multiple PDF in succession (no matter is it's selected or all pages), pages are completely mixed up.


    Any clue?

  • Hi,


    I've got that info from users, so I have tried to simulate "fast printing", so here is the scenario.


    1. PDFs reside in the data base (table) as blobs.

    2. Depending on parameters, table records are shown in some kind of grid.

    3. When user double-clicks on the grid row, PDF is loaded from blob to stream and shown using WPdfView (loadfromstream).

    4. User prints PDF and then double-clicks on another row(record) and so on and on...


    I've tried this with option "print all pages" on 2 documents and the first document print

    is not complete (sometimes 1 page sometimes 2 pages). The second document (or the last one) print

    is complete.


    Also, when printing document to some PDF printer like "Microsoft print to PDF", after selecting pdf name and trying to close

    the form I've got "Invalid pointer operation". If I wait few seconds and close the form, form is closed regularly without an error.


    In the first scenario, one print is "replaced" with another one.

    In the second scenario, printing to PDF is "aborted" before the print is finished...so to speak and from 4 pages, it saved 1st page and 2nd page is blank.


    These situations have never occurred in version 2.


    Is there a possibility (WP3) to check if pages are completely sent to printer spool (without using Win APIs)?


    If this problem is solved in Wp4...we'll go for it.


    Thanks a lot

  • WPViewPDF 3 is really old and there are a lot of changes. I serviced that also for years.

    You can test V4 - the demo is practically not restricted.


    But here it seems so that you somehow unload the PDF while one is still printing.

    Did you lock your load logic until the print command has been returned? This can be implemented easily with a booleen variable.


    Checking the code in COMPDF_Print V4 sends messages to the calling window, this are


    MSGPDF_PRINTSTART = 110; // Param = page count in the printing cue (not the total page count)

    MSGPDF_PRINTPAGE = 111; // for each page, LParam = page number in document (see MSGPDF_PRINTPAGEPROGRESS)

    MSGPDF_PRINTEND = 112; // done, LParam=0

    MSGPDF_PRINTPAGEPROGRESS= 116; // Message to set prograsspar. param=position, max=param of MSGPDF_PRINTSTART

  • Did you lock your load logic until the print command has been returned?


    What do you mean by print command has been returned?

    Should I check retCode?

    Or to use OnViewerMessage to intercept Win msgs?


    Anyway, I've suggested my company to move to wp4.

  • Hello,


    I hope that this email finds you well.


    We have successfully integrated your component in to our systems, yet we are struggling to find the way to enable the 'selection' option in a printing dialog as shown below.


    Could you please help us?


    I look forward to hearing back from you.