Jump to content

Print PDF file through SM


This topic is 3880 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello,

In a work I do under FMP12A I can create a certificate in a model, show it and print it ; I can't do twice or more that operation because the first time is created and printed a serial number. So, after printing, I  save it in a pdf file.

I don't find how  I can open and print that pdf in another moment and looked in SM samples ; but I dont find anything !

Thanks to those who can help me !

Noël

 

Link to comment
Share on other sites

Hi Noël,

 

360Works plugin functions will return a value when they are called, and if you use a Set Variable script step to execute the plugin function, you will capture the result of the function. Usually these values are true for success or false for failure, but when you save a file, the function result is most always the path to the saved file. 

 

Can you tell me which ScriptMaster function you are using? I could point you to some documentation and show you some example syntax.

Link to comment
Share on other sites

Hello,

Thanks for your answer. But as I said I don't have find a function and was asking the community to tell me what I can use to do that !

Now I have the following situation :

I can create a report, print it and save it as a  pdf file.

I can reopen and print these pdf from file maker but one by one.

 

I should like, after having done a selection, to create a script which would print all these pdf without any intervention of the user.

 

Hope my english is not too bad !

Noël

Link to comment
Share on other sites

Hello Joe,

I show the report in preview mode, then I save it using the "save as pdf" command of FileMaker to a file in a folder of my hdd.

What I want is to "automatize"  the printing of some of these pdf files without any intervention of the user.

Link to comment
Share on other sites

Hi Noël,

 

I do not know a way to print the saved PDF files as a group once they have been saved. The problem is FileMaker does not have a way to print a file that is separate from itself, and after you save a report to PDF, it is essentially separated from FileMaker.

 

But it is possible to print each report as they are being saved to PDF. Take a look at these two links for the FileMaker Print script step: 

http://www.filemaker.com/12help/html/scripts_ref2.37.26.html#1028386

http://www.filemaker.com/12help/html/scripts_ref2.37.25.html#1028361

 

You could create a script that saves the report to PDF, and in that script, you could add steps that would also print the report to a printer. You could tie the script to a button on the report layout. You could even create a script that loops through all the reports you want to generate and save/print one report per loop. Everything you described is possible with a script including going to Preview mode as well as automatically saving the report as a PDF file to a folder in the hdd of the user. The nice thing about this method is that the report being printed should look just like the PDF file.

 

One note: remember that this script will be run from the user's context which means you will need to save the file to a generic location that you know will be available on the user's machine (like their Desktop or Temp directory). You may also want to let the user decide which printer to use during the Print script step since it could be hard or impossible to predict the printer they are using.

 

Let me know if this helps!

Link to comment
Share on other sites

John !

I have been able to solve may problem using another way  http://campsoftware....from-filemaker/

But I'm curious of your solution and this is my situation :

  • as I said in my first message, the first time I print the document a specific unique number is created and printed.
  • the document is then saved as a pdf file and I can open it and print it
  • What I asked for was  how to print some of these pdf files previously choosed , without any intervention...

Is that more clear (with an approximative english) ?

Noël

Link to comment
Share on other sites

Noel

 

This can be accomplished using the java awt stuff to any installed printer.

I have it working if you want to give more specific details of your workflow...

 

 

John

Hello John !

I'm coming back near you because the solution I had found doesn't work under runtime ! I had totally forgotten this detail !

So can you explain me how I can replace the "Save to pdf" command by using ScriptMaster !

Hope in your help...

Noël

Link to comment
Share on other sites

Bit trickier than just printing but still absolutely possible with ScriptMaster (or a built plugin) and iText... 

Making the PDF from scratch and then printing it are possible.but it depends on the exact design of the PDF and where its data comes from..

The licence conditions need to be considered as at that point you need to work out how to make the iText code appear open source.. but it really is possible.

Can you send me a sample PDF so I can see what you are trying to achieve?

Link to comment
Share on other sites

Hello John,

Thanks for your help. I know that it's possible, but I'm not a professional and I'm afraid by iText in action I try to read !

I use two forms according it's a person or a school (I'm teacher). I join the two pdf and screen-copies of the models.

Cordially

Archive.zip

Link to comment
Share on other sites

This topic is 3880 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.