telerik pdf viewer mvc : Convert pdf file into jpg format control SDK platform web page wpf html web browser Enterprise-Development-with-Flex53-part753

this class in your LiveCycle8.2 installation directory at …\LiveCycle_ES_SDK\misc
\Process_Management\Workspace.
LiveCycle FormConnector
The conversation between a Flexlet and the Workspace happens through a Flash
sharedEvents
object. As a reminder, 
sharedEvents
is an 
EventDispatcher
that is
accessible both by the loading and the loaded SWFs. The loaded application accesses
it as 
systemManager.loaderInfo.sharedEvents
The loading application gets access to the very same 
EventDispatcher
object either as
swfLoader.swfBridge
if the two .swf files belong to the different security sandboxes, or
as 
swfLoader.content.loaderInfo.sharedEvents
if both SWFs are hosted by the same
security sandbox.
Accordingly, the Workspace dispatches its events, such as 
formInitialData
and
formSubmitDataRequest
, to the 
sharedEvents
and listens, on the same object, for the
events 
formReady
and 
formSubmitData
coming from the Flexlet.
Sending and receiving 
FormEvents
is greatly simplified by a helper class,
lc.core.FormConnector
. This class, an instance of 
EventDispatcher
, is provided by the
same workspace-runtime.swc library that contains the definition of the Workspace–
Flexlet conversation events. In particular, in the 
creationComplete()
event handler,
FormConnector
translates events intercepted on 
sharedEvents
into ones dispatched on
itself (see Example 10-1).
Example 10-1. FormConnector intercepts events on sharedEvents and redispatches them to itself
public function creationComplete(event:Event):void {
}
As a result, your Flexlet code does not have to listen directly to 
sharedEvents
. As long
as the Flexlet keeps an instance of the 
FormConnector
, it may instead listen to the
FormConnector
’s events. Example 10-2 shows how you can do it.
Example 10-2. A Flexlet can utilize the FormConnector to listen to events dispatched by the Workspace
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:lc="http://www.adobe.com/2006/livecycle">
<lc:FormConnector id="formConnector"
formInitialData="onFormInitialData(event)"
formSaveDataRequest="onFormSaveDataRequest(event)"
formSubmitDataRequest="onFormSubmitDataRequest(event)"/>
. . .
</mx:Application>
Creating Flex Applications Enabled for LiveCycle Workspace ES S | | 507
Convert pdf file into jpg format - Convert PDF to JPEG images in C#.net, ASP.NET MVC, WinForms, WPF project
How to convert PDF to JPEG using C#.NET PDF to JPEG conversion / converter library control SDK
change pdf into jpg; .pdf to .jpg online
Convert pdf file into jpg format - VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.net, ASP.NET MVC, WinForms, WPF project
Online Tutorial for PDF to JPEG (JPG) Conversion in VB.NET Image Application
batch pdf to jpg; c# pdf to jpg
To facilitate sending events to the Workspace, 
FormConnector
offers methods like
setSubmitData()
, which alleviates the need to explicitly dispatch the 
formSubmitData
event (Example 10-3).
Example 10-3. FormConnector wraps the data-sending event logic into a set of convenient methods
public function setSubmitData(data:XML):void {
dispatcher.dispatchEvent(
);
}
This allows a Flexlet to use calls such as 
formConnector.setSubmitData(data)
or
formConnector.setSubmitDataInvalid()
instead of dispatching the corresponding
events to 
loaderInfo.sharedEvents
(Example 10-4).
Example 10-4. A Flexlet can use the FormConnector API to simplify sending data events to the
Workspace
private function onFormSubmitDataRequest(event:Event):void   {
if (isDataValid()) {
 .  .
formConnector.setSubmitData(xml);
} else {
formConnector.setSubmitDataInvalid();
}
}
All human-centric processes in LiveCycle are created as long-lived processes. From the
persistence point of view, this means that LiveCycle stores all intermediate data that
needs to be passed between the operations of the process in its internal database (see
the documentation in LiveCycle Workbench Help, Creating Processes 
Process concepts
Process execution).
The question is, “How much data really needs to touch the LiveCycle database?” Or
rather, “How much of it should never leave your business database in the first place?”
Let’s look at the SimpleVacationRequest process. Clearly, the start and end dates of the
approved vacation need to be stored in the business database. Example 10-5 presents
the 
CREATE TABLE
statement that describes the structure of the corresponding vacation-
request table from the farata_livecycle_sampledb database.
Example 10-5. Definition of the vacationrequest table from farata_livecycle_sampledb (MySQL)
CREATE TABLE  vacationrequest (
Request_ID varchar(60) NOT NULL,
Description varchar(500) NULL,
Status varchar(30) NOT NULL,
Start_Date datetime NULL,
508 | | Chapter 10: Developing Flex Applications for LiveCycle Enterprise Suite
Online Convert Jpeg to PDF file. Best free online export Jpg image
So, feel free to convert them too with our tool. Easy converting! If you want to turn PDF file into image file format in C# application, then RasterEdge
advanced pdf to jpg converter; change pdf to jpg image
C# PDF Convert to Images SDK: Convert PDF to png, gif images in C#
to multiple image forms, including Jpg, Png, Bmp Turn multipage PDF file into single image files respectively in use this sample code to convert PDF file to Png
change pdf to jpg on; pdf to jpg converter
End_Date datetime NULL,
Employee_ID varchar(100) default NOT NULL,
Employee_Name varchar(120) default NOT NULL,
Vacation_Type varchar(30) NOT NULL,
Decision tinyint(1) default NULL,
Decision_Made_At datetime default NULL,
Employee_Email varchar(100) default NULL,
Department varchar(100) default NULL,
PRIMARY KEY  (Request_ID)
)
Given the 
requestId
, all the table data can be accessed by the Flexlet, through, for
instance, remote calls to Java methods that access the database through a JDBC layer.
Seemingly, the only data that needs to be passed between the process and the Flexlet
is the following:
<vacationRequest>
<requestId>8CE28354-E831-11E8-76EB-4DE38A29F087</requestId>
<isEmployee>true</isEmployee>
</vacationRequest>
In this snippet, 
requestId
is the key to the database record and 
isEmployee
is a view
selector the Flexlet uses to present different UIs to the employee and the approving
manager.
The 
requestData
node has extra nodes: 
decision
employeeName
, and 
duration
, because
it’s not only about a Flexlet, it’s also about the process (see Example 10-6).
For instance, while creating the Task Instructions Template of the Manager’s Review
task, it was convenient to use all these nodes in the template expression.
The bottom line is this: although you should avoid carrying business data in your
process variables, exercise your own judgment.
Example 10-6. Form data XML of the requestData form variable
<vacationRequest>
<requestId>8CE28354-E831-11E8-76EB-4DE38A29F087</requestId>
<decision>approved</decision>
<duration>7</duration>
<isEmployee>true</isEmployee>
<employeeName>Rye Woodard</employeeName>
</vacationRequest>
Flexlet Code Walkthrough
Let’s examine the Flexlet’s namespaces and variables. After doing so, you will learn
how the Flexlet gets the incoming process data that it uses to read more data from the
enterprise data store. Finally, you will learn how the Flexlet writes the data to
the enterprise data store and follows up with submitting the output data back to the
process.
Creating Flex Applications Enabled for LiveCycle Workspace ES S | | 509
C# Create PDF from images Library to convert Jpeg, png images to
Batch convert PDF documents from multiple image formats, including Jpg, Png, Bmp, Gif, Tiff If you want to turn PDF file into image file format in C#
convert pdf file to jpg file; convert pdf to high quality jpg
C# PDF Convert to Tiff SDK: Convert PDF to tiff images in C#.net
zoomValue, The magnification of the original PDF page size Any valid file path on the disk Description: Convert to DOCX/TIFF with specified zoom value and save it
convert pdf into jpg; convert pdf to jpg 300 dpi
Namespaces and variables
In addition to the traditional http://www.adobe.com/2006/mxml, the Flexlet application
declares two extra namespaces (Example 10-7):
http://www.adobe.com/2006/livecycle
To allow reference of the 
FormConnector
helper from workspace-runtime.swc.
http://www.faratasystems.com/2008/components
To allow references to controls from the clear.swc component library made by
Farata Systems. Components such as 
DataCollection
DataForm
, and
DataFormItem
were described in Chapter 3.
Example 10-7. Namespaces of the SimpleVacationRequest.swf Flexlet
<mx:Application width="100%" height="100%" layout="absolute"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:lc="http://www.adobe.com/2006/livecycle"
xmlns:fx="http://www.faratasystems.com/2008/components"
creationComplete="onCreationComplete()"
>
As explained earlier, 
FormConnector
facilitates exchange of the data events with the
Workspace. In addition, our Flexlet conducts independent data exchange with the
farata_livecycle_sampledb database. This is done using the 
requestsCollection
varia-
ble, which is a 
DataCollection
object (see Chapter 3) capable of talking to the database
through its 
fill()
and 
sync()
methods, as shown in Example 10-8.
Example 10-8. DataCollection variable: requestsCollection encapsulates data exchange between the
Flexlet and the database
import com.theriabook.collections.DataCollection;
private var requestsCollection:DataCollection = new DataCollection();
 .  .
// Invoke remote method to retrieve the existing vacation request record
var token:AsyncToken = requestsCollection.fill(requestId);
 .  .
// Invoke remote method to the database with the current state of
// the vacation request
var token:AsyncToken = requestsCollection.sync();
The Flexlet also declares a bindable variable, 
vacationRequestDTO
, that is used as the
dataProvider
for the 
DataForm
(see Chapter 3). As a reminder, 
DataForm
provides the
same convenience in regards to binding as 
DataGrid
. As soon as the user modifies a
property of the 
vacationRequestDTO
, the corresponding input control is updated and
vice versa (Example 10-9).
510 | | Chapter 10: Developing Flex Applications for LiveCycle Enterprise Suite
C# PDF File Merge Library: Merge, append PDF files in C#.net, ASP.
Combine scanned images to PDF, such as tiff, jpg, png, gif, bmp, etc. Description: Combine the source PDF streams into one PDF file and save it into a new
convert pdf pictures to jpg; bulk pdf to jpg converter online
VB.NET PDF File Merge Library: Merge, append PDF files in vb.net
This part illustrates how to combine three PDF files into a new file in VB.NET application. You may also combine more PDF documents together.
convert pdf photo to jpg; convert from pdf to jpg
Example 10-9. Use of DataForm provides automatic two-way binding between the bindable properties
of vacationRequestDTO and form items
import com.farata.datasource.dto.VacationRequestDTO;
[Bindable] private var vacationRequestDTO:VacationRequestDTO ;
 .  .
<fx:DataForm id="left" width="100%" dataProvider="{vacationRequestDTO}">
<fx:DataFormItem label="Employee Name: " fontWeight="bold"
dataField="EMPLOYEE_NAME" required="true"
validators="{[nameValidator]}">
<mx:TextInput  fontWeight="normal" editable="{isEmployee}" />
</fx:DataFormItem>
 .  .
</fx:DataForm>
Finally, the Flexlet declares another bindable variable 
isEmployee
that is used to alter-
nate between the two view states of the form: the Employee’s View and Manager’s
View. This property is managed exclusively by the process. The Flexlet obtains it as
part of the 
onFormInitialData()
event handler, as Example 10-10 demonstrates.
Example 10-10. Boolean variable isEmployee is used to alternate between two “views” of the Flexlet:
Manager’s View and Employee’s View
[Bindable] private var isEmployee:Boolean = false ;
 . .
private function onFormInitialData(event: DataEvent): void   {
if ((event.data != null) || (event.data != " ")) {
var requestData:XML = new XML(event.data);
var xmlList:XMLList = requestData.isEmployee;
isEmployee = (xmlList.toString()!="false");
 .  .
}
Reading data from the process and enterprise data store
The Flexlet has to ask the Workspace to feed it with the process data. It makes sense
to do it in the 
onCreationComplete()
handler, shown in part in Example 10-11. The
formConnector.setReady()
serves precisely this purpose. The rest of the
oncreationComplete()
handler is initializing 
requestsCollection
to communicate with
the remote destination 
com.farata.datasource.VacationRequest
.
Example 10-11. Snippet of the onCreationComplete() event handler
requestsCollection.method = "getVacationRequest";
requestsCollection.addEventListener(
ResultEvent.RESULT,
function(event:ResultEvent):void {
if (event.token.method == "fill") {
onRequestsCollectionFill(event);
} else {
onRequestsCollectionSync(event);
}
Creating Flex Applications Enabled for LiveCycle Workspace ES S | | 511
JPEG Image Viewer| What is JPEG
an easy-to-use interface enabling you to quickly convert your JPEG images into other file formats, including Bitmap, Png, Gif, Tiff, PDF, MS-Word
change pdf to jpg; change pdf file to jpg
VB.NET Word: Word to JPEG Image Converter in .NET Application
NET example below on how to convert a local use DOCXDecoder open a word file Dim pageCount provide powerful & profession imaging controls, PDF document, image
to jpeg; reader pdf to jpeg
}
);
requestsCollection.addEventListener(FaultEvent.FAULT, onFault);
The Java code for this destination has been generated by the Clear Data Builder (see
Chapters 1 and 6) based on the abstract class in Example 10-12.
Example 10-12. Abstract Java class used by Clear Data Builder to generate all Java artifacts required
to remotely access and modify the VacationRequest table of the farata_livecycle_sampledb database
package com.farata.datasource;
import java.util.List;
/**
* @daoflex:webservice
*   pool=jdbc/farata
*/
@SuppressWarnings("unchecked")
public abstract class VacationRequest
{
/**
* @daoflex:sql
 sql=::  select * from VacationRequest
 ::
 transferType=VacationRequestDTO[]
 keyColumns=Request_ID
 updateTable=VacationRequest
*/
public abstract List getAllRequests();
/**
* @daoflex:sql
 sql=::  select * from VacationRequest where Request_ID=:reqId
 ::
 transferType=VacationRequestDTO[]
 keyColumns=Request_ID
 updateTable=VacationRequest
*/
public abstract List getVacationRequest(String reqId);
}
The actual feed of the process data into the Flexlet happens within the 
onFormInitial
Data()
handler. Remember, the Workspace sends a 
formInitialData
event in response
to the 
setReady
event. 
event.data
should bring the XML corresponding to the process
variable 
requestData
(in other words, 
process_data/requestData
).
If this XML contains 
requestId
, the Flexlet issues the asynchronous 
fill()
call; oth-
erwise, it creates the brand-new vacation request record. The latter case corresponds
to the use case where the process 
Form
variable and, accordingly, the Flexlet start the
process. Either way, the Flexlet populates the value of 
vacationRequestDTO
with the
vacation request record (Example 10-13).
512 | | Chapter 10: Developing Flex Applications for LiveCycle Enterprise Suite
VB.NET Create PDF from images Library to convert Jpeg, png images
Components to batch convert PDF documents in Visual Basic .NET class. If you want to turn PDF file into image file format in VB.NET class, then RasterEdge
batch pdf to jpg converter; change file from pdf to jpg on
VB.NET PDF insert image library: insert images into PDF in vb.net
Save changes to existing PDF file or output a new PDF file. Insert images into PDF form field in VB.NET. to provide users the most individualized PDF page image
change pdf to jpg image; convert pdf to jpg for online
Example 10-13. For existing requests the Flexlet brings all data from the database
private function onFormInitialData(event: DataEvent): void   {
if ((event.data != null) || (event.data != " ")) {
var requestData:XML = new XML(event.data);
var xmlList:XMLList = requestData.isEmployee;
isEmployee = (xmlList.toString()!="false");
var requestId:String = requestData.requestId;
if ( requestId && requestId != "") {
var token:AsyncToken = requestsCollection.fill(requestId);
token.requestId = requestId;
} else {
// create a new request
vacationRequestDTO = new VacationRequestDTO;
vacationRequestDTO.REQUEST_ID = UIDUtil.createUID();
vacationRequestDTO.STATUS = "Created";
vacationRequestDTO.START_DATE = new Date(
new Date().time + 1000 * 3600 * 24
);
var authenticatedUser:User = WorkspaceSession.getSessionManager(
Application.application.session).authenticatedUser;
vacationRequestDTO.EMPLOYEE_NAME = authenticatedUser.displayName;
vacationRequestDTO.EMPLOYEE_EMAIL = authenticatedUser.email;
vacationRequestDTO.VACATION_TYPE = "L"; //Unpaid leave - default
requestsCollection.addItem(vacationRequestDTO);
isEmployee = true;
}
formConnector.setClean();
}
}
private function onRequestsCollectionFill( event:ResultEvent ):void {
var requestId:String = event.token.requestId;
if ( requestsCollection.length > 0 ){
vacationRequestDTO = requestsCollection[0];
} else {
Alert.show("Vacation Request was not found: " + requestId);
}
}
Writing data to the enterprise data store and the process
Remember the persistence motto: keep the enterprise data in the enterprise data store.
For the Flexlet, this means: save the data to the enterprise store first and then let the
process know only the bare minimum. Accordingly, the event sending the call 
formCon
nector.setSubmitData()
is not being issued directly from the 
onFormSubmitDataRe
quest()
handler. Instead, the handler just initiates the remote update of the data store
by calling the 
sync()
method of the 
requestsCollection
, as you can see in
Example 10-14.
Creating Flex Applications Enabled for LiveCycle Workspace ES S | | 513
Example 10-14. Event handler onFormSubmitDataRequest() updates the database instead of sending
the event to the Workspace
private function onFormSubmitDataRequest(event:Event):void   {
if (isDataValid()) {
applyDecision();
vacationRequestDTO.DECISION_MADE_AT = new Date();
var token:AsyncToken = requestsCollection.sync();
token.submit = true;
} else {
formConnector.setSubmitDataInvalid();
}
}
Once the update of the enterprise data store is complete within the
onRequestsCollectionSync()
body, the Flexlet can confidently return to process the
new value of the form data and cease to exist (Example 10-15). Please note that
onFormSaveDataRequest()
is organized in a similar way, with one exception: it does not
have 
token.submit=true
, which affects the logic of the 
onRequestsCollectionSync()
method.
Example 10-15. Flexlet submits the data to the process only after the database has been updated
private function onRequestsCollectionSync( event:ResultEvent ):void {
var duration:Number = 0;
if ((vacationRequestDTO.START_DATE != null) &&
(vacationRequestDTO.END_DATE!=null)) {
duration = Math.ceil((vacationRequestDTO.END_DATE.time -
}
var requestData:XML = <vacationRequest>
<requestId> {vacationRequestDTO.REQUEST_ID}</requestId>
<decision>{decision.selectedItem.data}</decision>
<duration>{duration}</duration>
<isEmployee>{isEmployee}</isEmployee>
<employeeName>{vacationRequestDTO.EMPLOYEE_NAME}</employeeName>
</vacationRequest>;
if ( event.token.submit ){
formConnector.setSubmitData(requestData);
} else {
formConnector.setSaveData(requestData);
formConnector.setClean();
}
}
Example 10-16 presents the complete code of the Flexlet SimpleVacationRequest.
Example 10-16. Complete code of the SimpleVacationRequest Flexlet
<?xml version="1.0" encoding="utf-8"?>
<mx:Application width="100%" height="100%" layout="absolute"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:lc="http://www.adobe.com/2006/livecycle"
514 | | Chapter 10: Developing Flex Applications for LiveCycle Enterprise Suite
xmlns:fx="http://www.faratasystems.com/2008/components"
creationComplete="onCreationComplete()"
>
<lc:FormConnector id="formConnector"
formInitialData="onFormInitialData(event)"
formSaveDataRequest="onFormSaveDataRequest(event)"
formSubmitDataRequest="onFormSubmitDataRequest(event)"/>
<mx:VBox width="100%" height="100%" backgroundColor="white">
fontWeight="bold"
fontSize="16"
fontStyle="italic"
paddingTop="10"
paddingBottom="5"
paddingLeft="10"
/>
<mx:HBox width="100%" height="100%" >
<fx:DataForm id="left" width="100%"
dataProvider="{vacationRequestDTO}">
<fx:DataFormItem label="Employee Name: " fontWeight="bold"
dataField="EMPLOYEE_NAME" required="true"
validators="{[nameValidator]}">
<mx:TextInput  fontWeight="normal" editable="{isEmployee}" />
</fx:DataFormItem>
<fx:DataFormItem label="Employee Email: " fontWeight="bold"
dataField="EMPLOYEE_EMAIL" required="true"
validators="{[emailValidator]}">
<mx:TextInput   fontWeight="normal" editable="{isEmployee}"/>
</fx:DataFormItem>
<fx:DataFormItem label="Department: " fontWeight="bold"
dataField="DEPARTMENT" required="true"
validators="{[departmentValidator]}">
<fx:TextInput fontWeight="normal" editable="{isEmployee}"/>
</fx:DataFormItem>
<mx:Spacer height="10"/>
<fx:DataFormItem label="Description: " fontWeight="bold"
dataField="DESCRIPTION">
<mx:TextArea width="200"  height="80" fontWeight="normal" />
</fx:DataFormItem>
</fx:DataForm>
<fx:DataForm id="right" width="100%"
dataProvider="{vacationRequestDTO}">
<fx:DataFormItem label="Start Date: " fontWeight="bold"
<mx:DateField fontWeight="normal"  enabled="{isEmployee}"/>
</fx:DataFormItem>
<fx:DataFormItem label="End Date: " fontWeight="bold"
dataField="END_DATE" valueName="selectedDate" required="true">
<mx:DateField  fontWeight="normal" enabled="{isEmployee}"/>
<fx:validators>
<mx:Array>
<fx:ValidationRule
rule="{
Creating Flex Applications Enabled for LiveCycle Workspace ES S | | 515
function(data:Object):Boolean {
return data.START_DATE >= data.END_DATE;
}
}"
errorMessage="End Date must be later than Start Date">
</fx:ValidationRule>
</mx:Array>
</fx:validators>
</fx:DataFormItem>
<fx:DataFormItem label="Vacation Type: " fontWeight="bold"
dataField="VACATION_TYPE"
resource="{com.farata.resources.VacationTypeComboResource}"
enabled="{isEmployee}" required="true">
</fx:DataFormItem>
<fx:DataFormItem label="Request Status: " fontWeight="bold"
dataField="STATUS">
<mx:Label  fontWeight="normal"/>
</fx:DataFormItem>
fontWeight="bold"  visible="{!isEmployee}">
<mx:ComboBox id="decision">
<mx:Array>
<mx:Object label="Approved" data="approved"/>
<mx:Object label="Rejected" data="rejected"/>
</mx:Array>
</mx:ComboBox>
</mx:FormItem>
</fx:DataForm>
</mx:HBox>
</mx:VBox>
<mx:Script>
<![CDATA[
import com.farata.datasource.dto.VacationRequestDTO;
import com.farata.resources.VacationTypeComboResource;
import com.theriabook.collections.DataCollection;
import com.farata.datasource.dto.VacationRequestDTO;
import lc.core.WorkspaceDataService;
import lc.domain.User;
import lc.domain.workspace.WorkspaceSession;
import mx.rpc.events.FaultEvent;
import mx.rpc.AsyncToken;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.utils.UIDUtil;
[Bindable] private var vacationRequestDTO:VacationRequestDTO ;
[Bindable] private var isEmployee:Boolean = false ;
private function onCreationComplete():void {
formConnector.setReady();
516 | | Chapter 10: Developing Flex Applications for LiveCycle Enterprise Suite
Documents you may be interested
Documents you may be interested