HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › PD4ML Tips & Tricks › initialPageNumber
- This topic has 16 replies, 3 voices, and was last updated Jul 19, 2013
20:32:21 by PD4ML.
-
AuthorPosts
-
February 11, 2011 at 15:51#26515
Hello,
i’m wondering, if it is possible to set the initial page number to something specific, if a passthru within a php page is used, something along the lines:
passthru(‘java -Xmx512m -Djava.awt.headless=true ‘ . ‘-cp ../pd4ml/pd4ml_demo.jar Pd4Cmd ” . $url . ” 800 A4 -smarttablesplit -author ‘Author’ -insets 7,7,10,10,mm’ -param initialPageNumber ‘2’);
Thanks for the help!
Kind regards
Niels GöranFebruary 11, 2011 at 15:58#28386Unfortunately, currently there is no such parameter.
In theory you may add the feature by yourself: Pd4Cmd utility source code is available for free download; PD4ML header/footer Java API has a method to set the page counter initial value.
If you are already our customer, we could add the feature to the main PD4ML development branch.
February 11, 2011 at 16:14#28387Hey…
Thank you for your answer…
The idea to add the feature myself sounds good.Could give me some advice regarding the general structure of such an implementation?
Do I understand you correctly, that I would need to modify the source code for pd4ml_demo.jar, so that the Pd4Cmd sections is able to pass a new parameter to the Java API?
In addition, what is the difference between Pd4Cmd and Pd4Php ?
Thank you for your help!
Kind regards
Niels GöranFebruary 11, 2011 at 16:18#28388Hello,
one more question:
I’m using the smarttablesplit option and it works fine, with one exception:
It is not repeating thesection on the next page. Is there a reported problem with that function or is there another way to make this work? It would be really helpful !
Kind regards
Niels GöranFebruary 11, 2011 at 17:01#28389> Could give me some advice regarding the general structure of such an implementation?
> Do I understand you correctly, that I would need to modify the source code for pd4ml_demo.jar, so that the Pd4Cmd sections is able to pass a new parameter to the Java API?You may rename the class, modify, compile and leave the original Pd4Cmd packed to pd4ml(_demo).jar untouched.
You need to invoke the method. But now I am not sure if it will work for inline headers/footers. Next week we’ll check that and most probably add the missing parameter to Pd4Cmd.
> In addition, what is the difference between Pd4Cmd and Pd4Php ?
Pd4Php was the first command line tool version. After we added more general purpose functions we renamed it to Pd4Cmd.February 11, 2011 at 17:04#28390> It is not repeating the
section on the next page. In the mode it repeats all leading
tags if they consist of
tags only.
February 14, 2011 at 09:14#28391Hey…
Thank you very much for your reply.
It would be really great, if you could add that feature.Looking forward to testing the new version!
Kind regards
Niels GöranFebruary 18, 2011 at 13:58#28392Hello pd4ml-team,
I just would like to know, what the status is on the initialPageNumber parameter.
We are about to deploy the solution for our customer, so it would be really great to have this feature already in place for the customer (We will buy the license soon).Thank you for your help!
Kind regards
Niels Göran BlumeFebruary 22, 2011 at 15:07#28393The feature is still under development – there are some technical complexities with the implementation. In a couple of days we’ll inform you if it is going to be included to the forthcoming release.
February 24, 2011 at 19:25#28394A version with the feature (v370fx2) is already available for download.
In command line an initial page number can be defined like that:
… -param pd4ml.initial.page.number 3Unfortunately in RTF format we found no way to impact total number of pages value correspondingly, as it is by PDF output.
February 28, 2011 at 10:56#28395Hello !
Works great !!
Thank you very much for your help and the quick adding of the feature !
I’m going to get my supervisor to order the pro license as soon as possible.Thanks again !
Kind regards
Niels GöranNovember 26, 2011 at 23:37#28396Hey…
I come across another questions while further implementing PD4ML.
We are trying got use “pd4ml.print.dialog.popup”, but again it is not available via PHP param feature.
Is there a different way to force the print window? Or do we have to implement it in the wrapper ourself? (If you could provide us with that feature as you did last time, that would be really great.).And the second questions relates unique numbers in printed documents.
We create PDF files with tags on each page, and each tag has its unique number.
Now we want to directly print that page out instead of opening the PDF in the user window (even when the print dialog opens directly, there is no way to tell if the tags were printed or not…).
Is there any simple to do that? One suggestion we found was to write the PDFs in a specific folder on the server, and have the server check for the files and each time it found one, that one will be printed.Thank you very much for your Help!
Kind regards
Niels GöranNovember 28, 2011 at 13:55#28397In theory the following command-line parameter should produce PDFs pop the print dialog automatically up:
-param pd4ml.print.dialog.popup true
Please give a try.I am not sure if I understood your second question correctly, as “PDF tag” can mean different things.
So you would like to autoprint some sections of generated PDF documents? I do not know what you are going to use on the sever side as a print application, but if it should be “standard” Acroread, I would to take a look to the attached document. Acroread command-line parameters allow to jump to a particular section of a PDF document (marked as a named destination).
By the link you may find Acroread command line options for silent printing:
html-pdf-faq-f1/automatically-open-print-dialog-t158.htmlProbably by combining the named destination jump and the silent print command you’ll achieve the needed functionality.
November 30, 2011 at 01:10#28398Hello,
thank you very much for your answer…
The first part of the answer solved the problem completely.
That’s exactly the command I was looking for..The second part I explained very poorly. Within the company I work for, we use certain tags to label specific parts, kind of like price tags.
These tags are supposed to be containing consecutive numbers..
Therefore we have to make sure, that each number is only printed once..
If we open the PDF file, even with the printing dialog directly opened, there still is the chance, that the file with for example the numbers 1 through 30, is printed multiple times. We are looking for a way to properly print the PDFs once and only once.
Our current approach would be to create the file and save it on the server (temporarily) and sent it to a printer selected by the user via network. After it was successfully printed, the file will be deleted and the first new number to be used will be saved in a database and used for generating the next set of “tags” with new numbers.I think that might be the most practical solution, since using the command line in combination with a webserver will get really difficult very quickly…
If you can offer any other idea, we would be more than happy to give it a try…
Thank you for your help!
Kind regards
Niels GöranDecember 5, 2011 at 21:50#28399So the print jobs are going to be initiated from the server side (not from client PC)? In the case you’ll anyway need to execute some print command line. I have my doubts if there is an easy way to talk from an application server to a printer (and to render/print a PDF, which is another level of complexity).
As for me a print.bat file with a singe command like
AcroRd32.exe /t %1 “\serverprintername” “Kyocera FS-1010” “192.168.0.1”
is quite a straightforward solution to be executed from the server like that:[language=java:2hutn6hr]String cmdstart[] = { “cmd.exe”, “/c”, “print.bat”, tempPdfLocation };
Runtime.getRuntime().exec(cmdstart);[/language:2hutn6hr]
Of course, printer names/locations could be passed to the script as a parameter as well. -
AuthorPosts
The forum ‘PD4ML Tips & Tricks’ is closed to new topics and replies.