interactive dynamic form - flattening without output

253 views
Skip to first unread message

BeetleVW

unread,
Sep 15, 2010, 10:33:50 AM9/15/10
to Adobe LiveCycle Developers
Morning,

Is it possible to flatten a interactive dynamic form with using the
output service? The client I am currently working for doesn't own LC
Output. I figured I could have flattened the pdf with assembler
however getting an error that says I need output. Does anyone know of
any other way to get the form to flatten or end up with a print
version?

I looked into a custom xci @ render time but that didn't work or seem
to have the options required.

Thanks,
Carmen

Duane Nickull

unread,
Sep 15, 2010, 1:55:05 PM9/15/10
to Adobe LiveCycle Developers
I may have missed the correct answer but when I searched the API docs I found two candidates.  OutputResult has a getGeneratedDoc() method but this accepts no parameters to flag it as flattened.  I looked a bit further and I found the com.adobe.livecycle.output.client.OutputClient has methods that allow the creation of a Java object that invokes operations that belong to the Output service. Using this object, you can create document output streams using a form design and data to merge with the form design. For example, you can reference an existing form design and generate a print stream, such as one of the following formats:

    * A PDF or PDF/A document output stream.
    * An Adobe PostScript output stream.
    * A Printer Control Language (PCL) output stream.
    * A label format (ZPL, IPL, DPL and TPCL) output stream.

For a complete list of print streams, see the PrintFormat enumeration value.

The transformPDF method converts a document output stream to either non-interactive PDF or PDF/A format.

transformPDF((Document inPdfDoc, TransformationFormat transformationFormat, PDFARevisionNumber pdfaRevisionNumber, String pdfaAmendment, PDFAConformance pdfaConformance)
    

Duane
--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.



---
Adobe LiveCycle Enterprise Architecture - http://www.adobe.com/products/livecycle/
My TV Show - http://tv.adobe.com/show/duanes-world/
My Blog – http://technoracle.blogspot.com/
My Band – http://22ndcenturyofficial.com/
Twitter – http://twitter.com/duanechaos/


Rob McDougall

unread,
Sep 15, 2010, 2:53:42 PM9/15/10
to Adobe LiveCycle Developers
We've looked at this extensively on behalf of a client. There are
lots of ways that look promising however in the end they almost all
end up requiring LiveCycle Output. Adobe Acrobat will do it, but the
EULA prevents you from running it on a server. PDF Generator comes
with a copy of Acrobat, but again the EULA prevents it from being used
outside of the PDFG context.

The only way we found that looks like it would work requires PDF
Generator. Theoretically, one could write a native application PDF
conversion script to drive Adobe Acrobat to convert a dynamic PDF to a
static PDF however the manuals indicate that this is probably a 6-8
week development task.

This really leaves you with two choices - use a script to change all
the fields to being "readOnly" - thus creating a non-interactive
interactive form, or buying LiveCycle Output to create a non-
interactive flat PDF.

Regards,
Rob

Rob McDougall | Senior Technical Architect | 4Point | www.4Point.com

>
> On 9/15/10 7:33 AM, "BeetleVW" <cmil...@miller-clan.com> wrote:
>
> Morning,
>
> Is it possible to flatten a interactive dynamic form with[out] using the

Duane Nickull

unread,
Sep 15, 2010, 3:31:14 PM9/15/10
to Adobe LiveCycle Developers
D’oh!!

I misread the original post.  Didn’t notice the “without” Output.

Thanks Rob – this is good advice.

D
--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.


Aditya Shah

unread,
Sep 15, 2010, 3:40:01 PM9/15/10
to live...@googlegroups.com
This is a useful post. 

Rob - I would appreciate if you could tell me what is the EULA ...

Aditya
image.jpg

Dave Watts

unread,
Sep 19, 2010, 11:25:50 PM9/19/10
to live...@googlegroups.com

I'm not Rob, but I can tell you what the EULA is. It stands for "End User License Agreement" and it limits what you can do with the software you buy. In the case of Acrobat, the license has strict limitations on using Acrobat on a server.

As for your original question, I think you can flatten PDFs on the server using iText, a free, open-source Java library.

Dave Watts, CTO, Fig Leaf Software

Sent from my Droid

Angie Okamoto

unread,
Sep 20, 2010, 12:09:02 AM9/20/10
to live...@googlegroups.com
iText is not able to flatten a dynamic XFA based document.
If you have LCForms, you can make all the fields protected/read-only.
To flatten, you will need Output.
 
Angie

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.



--
Angie Okamoto

Rob McDougall

unread,
Sep 21, 2010, 10:17:49 AM9/21/10
to Adobe LiveCycle Developers
Dave's explanation is correct. It's the thing everyone agrees to
without reading during installation. :)

As Angie says, you can always make your interactive form less
interactive by changing all the fields to read-only/protected. This
creates a non-interactive, interactive form. This is typically larger
than a flattened form because the interactivity is still there, it's
just turned off. There are some occasional small behaviour
differences as well (e.g. if a read-only field is changed with script
on the client, this can cause a warning to appear on a non-Reader
extended form if you try and save it).

If you're a bit more adventurous and feel comfortable playing with the
XML directly, there's another option available in access attribute
besides "readOnly" and "protected" - "nonInteractive". This is
detailed in the XFA specification and produces a result that is closer
to a flattened form however you have to make sure all your scripts run
at server. I believe this locks things down during the initial server
render however I haven't used it much so I can't say if there are any
other implications.

Regards,
Rob

Rob McDougall | Senior Technical Architect | 4Point | www.4Point.com


abhilash ys

unread,
Mar 30, 2020, 8:07:04 AM3/30/20
to Adobe LiveCycle Developers

Hi Angie,

Seeing your post i have few questions. We have a requirement to  convert PDF to TIFF. PDF is generated from generatePDF output service which is non interative one. i am using toimage service to convert to TIFF.. but not all pages of PDF are being converted. 
The generate PDF output still has some XFA and it is not complete  flattened. thus request in not proper TIFF. can you help me in way withing workbench to make the pdf output as completely flat without any pdf restriction options ? so that it can be used to convert to tiff.

Using itext i am able to convert to complete flatten pdf with no restriction. but we have restrictions to use itext code as of now. need way with aem.

Thanks much
Abhilash

adamjoel79

unread,
Mar 30, 2020, 11:04:37 AM3/30/20
to Adobe LiveCycle Developers
Hi Abhilash, a good option for you might be to use this program as a TIFF Printer (it is free, but you can purchase a copy - if it helps it's worth it) https://download.cnet.com/PDFill-Free-PDF-Editor-Basic/3001-18497_4-77622696.html?part=dl-

Create a button in the form and call it "Print to TIFF" (or whatever you want) and use the following code on CLICK event:

var pp = event.target.getPrintParams();
    pp.interactive = pp.constants.interactionLevel.automatic;
    pp.printerName = "PDFill PDF&Image Writer"; // <---- Can be network path with printer name if insalled on a print server or shared printer
    pp.printAsImage = true;
    event.target.print(pp);

If the form is in a shared location (people access over network) you can change "printerName" to be the shared printer location / name and install it to the server.

Once it is clicked it should show TIFF as default image type to print and prompt for file name & save location.

This is how the program should be configured:

PDFill.jpg



Thanks and have a great day!

- Adam

fred.pantalone

unread,
Mar 31, 2020, 11:51:47 AM3/31/20
to Adobe LiveCycle Developers
Hi there. You should note that this thread is 10 years old! How do you know that the PDF output still has "some XFA"? Are you creating a PDF/A with Output?

Fred

abhilash ys

unread,
Apr 5, 2020, 12:57:43 AM4/5/20
to Adobe LiveCycle Developers
Hi Fred,

Thanks for your response. The way we did this is, The generated output PDF is tried to convert to PDFA, TIFF, Postscript and in all the cases the converted output was not the same as initial PDF passed. 

All the rules/hiding logics are being ignored while conversion.

Activities used from AEM workbench

generatePDFOutput --> toimage(TIFF) , ExportPDF, toPS. 

The issue being here is the the rules./hiding logics are added using XFA objects Java script in the form designer.
These all are picked from the form for PDF generation but not during convertion.

Please let me know if you need more details here.

Thanks much for the support

abhilash ys

unread,
Apr 5, 2020, 1:03:30 AM4/5/20
to Adobe LiveCycle Developers
Thanks much Adam, i will have a check on this one. Looks promising. 

fred.pantalone

unread,
Apr 5, 2020, 10:41:07 AM4/5/20
to Adobe LiveCycle Developers
Your scripts probably aren't being ignored, they're probably failing or not running on the appropriate events. This is probably going to take some time to debug but I don't see a reason why this shouldn't work. Are any of your rules/hiding scripts running properly? If so, which events are they causing them to run? Which events are you using for the scripts that are failing to run?

Fred

abhilash ys

unread,
Apr 6, 2020, 1:59:18 AM4/6/20
to Adobe LiveCycle Developers
Hi Fred,

Yes that might be a chance that it is not included. The Java script code using XFA are written in Initialize and Doc Ready events in the form designer.

Initialize event - where written codes/rules at early stage
Doc event - written code to hide the section after form is generated as we are making use of insertion points and fragments concept.


The reason why i mentioned earlier saying there are XFA tags present is when i pass the generated PDF to itext free site (https://itextpdf.com/en/demos/xfa-flattener) i see those embedded XFA tags showing and it allows to process the file to convert XFA free docment. But unfortunately  i cannot use itext code and want to perform the convertion within AEM workbench area. 

Thanks much

Regards,
Abhilash

abhilash ys

unread,
Apr 6, 2020, 2:00:21 AM4/6/20
to Adobe LiveCycle Developers
Adding to response - trying to generate complete XML/XFA tags free document within AEM workbench.

fred.pantalone

unread,
Apr 6, 2020, 12:11:36 PM4/6/20
to Adobe LiveCycle Developers
Hi,

Is there something about the missing pages that is peculiar? Regardless of what iText says about the PDF, does it look the way you want the TIFF version to look or is it also missing pages? Have you tried using Acrobat to verify PDF/A compliance? Go to Print Production/Preflight and select the appropriate profile to verify. 

Fred

abhilash ys

unread,
Apr 7, 2020, 11:50:28 AM4/7/20
to live...@googlegroups.com
Hi Fred,

That's correct regardless of itext there are missing pages from the PDF and TIFF file.

PDF/A is acting just like the TIFF and PostScript where the javascript is not running during convertion.

Using converter services not sure why the javascript are not picking up during convertion. Do you thing anything to change in Admin UI/ config mang UI to change in this service?

For the Print PDF - The PDF is converted into print format with no data loss. Like the actually how we want.

Issue in print PDF -  How can i save this print PDF file within my AEM workbench?
I used generateprintedoutput activity but I am unable to save the generated PDF to pass the PDF to downstream. If I save this print file as .pdf it says the file is corrupted or not supported. 

Thank much for your support

Abhilash

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/livecycle/c566be6e-8a42-43db-9e90-c4509f0f9e80%40googlegroups.com.

fred.pantalone

unread,
Apr 8, 2020, 11:08:39 AM4/8/20
to Adobe LiveCycle Developers
Hi there,

There's a lot going on here and there's something that isn't clear to me. When you are invoking generatePDFOutput, are you using a PDF that has already been filled by a user or are you using a data file and an XDP?

generatePrintedOutput does not produce PDFs. It produces print files (PCL, PS, etc). 

Fred

To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+unsubscribe@googlegroups.com.

abhilash ys

unread,
Apr 8, 2020, 11:20:52 AM4/8/20
to live...@googlegroups.com
HI fred ,

Thanks for bearing with me on this. 

It's the data input XML file and XDP used.

The form XDP and the input data which is  XML data is been passed to generatePDF output . And fields are mapped with XSD. its dynamic.


Yes correct the generateprintedoutput produce ps,pcl and we are trying to convert this ps file to pdf where getting file format error to pdf generator error is coming   or ps to tiff directly where unable to convert to image error is popping.

Basically need PDF which has no XML source structure attached to it just like print file may be.

Need to figure out a way to generate pdf just like microsoft print to pdf format  when we try to print file so that the file dont hold any XML source structure during conversion.
 Hope this clears things up for you.

Awaiting for your reply on any pointer.

Abhilash.

To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/livecycle/73a609c0-05ce-4daa-813e-711325f8789b%40googlegroups.com.

Adam D.

unread,
Apr 8, 2020, 11:28:17 AM4/8/20
to abhilash ys, live...@googlegroups.com
as i posted before the option i gave you may be the fit you are looking for or in the print param options print as image pdf then its flattened and you can use adobe pdf as printer or a third party pribter like cute pdf or pdflite



- Adam

fred.pantalone

unread,
Apr 9, 2020, 10:58:02 AM4/9/20
to Adobe LiveCycle Developers
Ok, thanks for the clarification. You really need to go back to basics and debug the javascript that is doing all of the hiding/showing.Sometimes Output just doesn't work the same way and you have to figure out what works - something just isn't working correctly with this renderer. I'm certain that you can get it running properly but you're going to have to figure out where your code is failing first. My approach would be to cut the template down to the basics, where it looks like just one part of your script is failing and focus on that. 

Good luck!
Fred

To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+unsubscribe@googlegroups.com.

abhilash ys

unread,
Apr 9, 2020, 11:02:17 AM4/9/20
to live...@googlegroups.com
Thank you Fred. That really helps a lot.


To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/livecycle/0e76854a-0236-4ef9-940f-b0236ccde48c%40googlegroups.com.

fred.pantalone

unread,
Apr 9, 2020, 11:38:51 AM4/9/20
to Adobe LiveCycle Developers
No problem. If you get totally stuck I can take a look at your template.
Fred
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+unsubscribe@googlegroups.com.

Dave Venance

unread,
Apr 10, 2020, 12:16:17 AM4/10/20
to Adobe LiveCycle Developers
Hi Abhilash, so you mentioned that you have some script that runs on certain events.  Can you tell me if those scripts are set to run on the client or server or both?  If the scripts are not set to run on the server, they will never get fired.  Seeing your form template would really help here.

Dave
To unsubscribe from this group and stop receiving emails from it, send an email to live...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to live...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to live...@googlegroups.com.

abhilash ys

unread,
Apr 14, 2020, 8:13:00 AM4/14/20
to live...@googlegroups.com
Thanks Fred. Your suggestions really helped.

There were certain scripts running in late processing events like "doc ready", "layout ready". Now these all have been moved to initialize events and now I can generate complete no source pdf, complete flat pdf  :) 

Also along with above change this setup worked. - using forms service - renderpdf to generate form instead of generatepdfoutput and then use transformpdf activity to convert interactive pdf to flatten pdf.

Just wondering they all worked well in pdf generation perfectly. But not in the other converted format.


Hi Dave,
 Thanks for the response. Yes the scripts had both client and server running.


Thanks all for your help.


To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/livecycle/432bd3db-10d7-455c-acdd-81367d9a4c90%40googlegroups.com.⁸

fred.pantalone

unread,
Apr 15, 2020, 9:28:09 AM4/15/20
to Adobe LiveCycle Developers
This is great, thanks for posting your solution!
Fred
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+unsubscribe@googlegroups.com.

fred.pantalone

unread,
Apr 15, 2020, 9:41:41 AM4/15/20
to Adobe LiveCycle Developers
Regarding your question about differences in renderers (Forms vs Output), I don't know what's going on there. However, and as you know now, you can't assume that any renderer will behave the same way and this is especially true when it comes to scripts and events. It's similar with various clients (e.g. versions of Reader, Acrobat, and rendering HTML and working with different browsers). There could be some implementation differences that show up and really mess up the way your form behaves. I was once troubleshooting a form for a client that was really misbehaving during rendering/Reader-Extending. It turned out that they were trying to implement a "wait" function on initialize (I can't remember why) and using the system time to do this. Well, ARES didn't seem to have some of the time/date functions implemented so the wait loop was spinning infinitely and very tightly. It took a few days to find that one...

Fred

To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+unsubscribe@googlegroups.com.

abhilash ys

unread,
Apr 20, 2020, 10:38:48 AM4/20/20
to live...@googlegroups.com
Thanks much Fred. Yes, need to be careful in selecting the events to write JS which will work properly in renderer.

Abhilash 


To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to livecycle+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/livecycle/6fbff8b4-f906-49d7-9c8f-61da33ad3e5d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages