11 Replies Latest reply on Sep 23, 2010 12:12 PM by hkin

    Embedding Fonts with Forms Service RenderPDFForm

    Tom Weitzel
      We have several custom fonts being used in PDFs we're rendering using the Forms Service RenderPDFForm API. Rather than require consumers of these PDFs to have those fonts installed, we'd like to embed them in the PDFs being generated. Is it possible to embed fonts using RenderPDFForm?

      Tom
        • 1. Re: Embedding Fonts with Forms Service RenderPDFForm
          pguerett Level 6
          Yes ....the fonts must be available on the server so that they can be embedded. Assuming that is the case, the creation of the PDF is controlled by an xml configuration file called an xci file. There is a setting in there that will indicate whether fonts can be embedded or not. This setting has been exposed in the adminui for Forms (not sure which version it 1st appeared but it is in my 8.2 version). Log into adminui and click on the Services/LiveCycle Forms ES link. Scroll to the bottom of that screen and in th eembedded fonts section you can list the fonts that you always want to embed as well as the fonts that you never want to embed. Remember that the font has to be embeddable (the Font Manufacturer must allow it) before Livecycle will embed it in your PDF. If you have too many fonts to list you can change the xci file to always embed fonts (but this is an all or nothing type of switch). I do not recommend doing it this way.
          • 2. Re: Embedding Fonts with Forms Service RenderPDFForm
            Tom Weitzel Level 1
            Thanks for the reply. We do have a large number of fonts, so I'll have to see if it will take them all. Assuming it does, will all of those fonts always be embedded, or will it only embed those actually used on the form being rendered?
            • 3. Re: Embedding Fonts with Forms Service RenderPDFForm
              pguerett Level 6
              Its an all or nothing type of scenario.
              • 4. Re: Embedding Fonts with Forms Service RenderPDFForm
                Tom Weitzel Level 1
                I would like to try setting it to always embed all fonts. The documentation I've found says to find the pc.xci file, copy it, change the embed option and pass the URI to the new xci file in the PDFFormRenderSpec I'm passing in to renderPDFForm. That all makes sense to me, but I can't find the pc.xci file to start from. In a JBoss deployment, where do I find it? I've cracked open the LiveCycle ear file and several of the contained war/jar files.
                • 5. Re: Embedding Fonts with Forms Service RenderPDFForm
                  pguerett Level 6
                  The xci file is part of the dsc that is deployed in the DB .....not easy to change. HOw about we create a custom xci file and pass that into the call each time we make it? That technique is a lot easier and less likely to cuase issues later on (if you get a patch otr update your version then you would have to rebuild the jar file each time).

                  Are you familiar with the FormsIVS application that ships with Forms?
                  • 6. Re: Embedding Fonts with Forms Service RenderPDFForm
                    Tom Weitzel Level 1
                    That's where I was heading, as outlined in this KB article: http://kb.adobe.com/selfservice/viewContent.do?externalId=kb406973. I just needed some help getting the custom xci file created.

                    I'm not familiar with the FormsIVS application.

                    Many thanks for the help.
                    • 7. Re: Embedding Fonts with Forms Service RenderPDFForm
                      pguerett Level 6
                      In the adobe/LiveCycle8.2/deploy folder there is a file called:

                      adobe-forms-ivs-jboss.ear

                      Deploy that file on your app server (note that the name may change to reflect your app server). Once it is deployed you can access the application (it is a testing program for Forms). The URL is:

                      http://machinename:port/FormsIVS

                      Once it is loaded click on the preferences in the top right corner. Scroll to the bottom and add the administrator/password for your installation. In the first field (called Options) changed the parameter PADebug=0 to PADebug=1. Don't forget to hit the save button at the bottom of the screen. This will return you to the Test Form Design screen. Choose a form from the right List (I chose PurchaseOrder_Dynamic Interactive.xdp). In the Output format dropdown, choose PDFForm. Now click on the Use EJB button. A call to form server will be generated and returned to the screen. Because we have PADebug set to true the whole process is being traced. I am running a JBoss server so the files are written to:

                      C:\Adobe\LiveCycle8.2\jboss\server\all\svcdata\FormServer\Debug

                      It will be a different location depending on the appserver type you are running. In that folder is a file called:

                      debug_xci_pdf.xml

                      Make a copy of this file and rename it to MyTest.xci. This is the control file we will pass into the call and also modify to embed fonts. Open this file with an XML editor. In the xci file look for the pdf node under the present tag. In that node there is a child node called fontInfo. There is an embed tag in there that is set to 0. Change it to a 1 and save the file. Now in the call to Forms you can pass in a URI to this file in the XCI URI parameter. You can change this in the FormsIVS application in the options string and try it for yourself before changing our app. So now each time you want to embed the fonts pass the XCI URI into the call otherwise use the default one that is embedded in the jar file.

                      Let me know that it worked for you.
                      • 8. Re: Embedding Fonts with Forms Service RenderPDFForm
                        Tom Weitzel Level 1
                        Mission accomplished. I'm now getting PDFs that have subsets of all used fonts embedded.

                        Thanks!
                        • 9. Re: Embedding Fonts with Forms Service RenderPDFForm
                          parekhn Level 1

                          Hi Tom,

                           

                          So how did you embed the fonts? Exactly described by pguerett in previous post?

                           

                          Thanks.

                          • 10. Re: Embedding Fonts with Forms Service RenderPDFForm
                            Tom Weitzel Level 1

                            Yes. As soon as I started passing the URI for the custom XCI file in with my call to renderPDFForm, the server was sending back PDF with fonts embedded.

                             

                            Tom

                            • 11. Re: Embedding Fonts with Forms Service RenderPDFForm
                              hkin

                              HI all i have another question related to Custom.xci which can be used during runtime while rendering my XDP.

                               

                              In custom.xci file we hav an attribute named <pdf name=""> , which has all the settings we can aaply on the incoming PDF or XDP file.

                               

                              my question is if we provide the name of incomin PDF in here , will the settings under this <pdf> tag apply only to that PDF or XDP

                               

                              and if we want to apply diffreent settings to incoming PDF or XDP , can we copy the complete tag and paste in the custom.xci .....i tried doing this but settings corresponding to the first <pdf> tag is applied on all the incoming files.

                               

                              so i fear copying the tag is not helping, can anuone help me resolve this issue

                               

                               

                              ~

                              Hkin