Export to swf image to pdf or png - actionscript-3

I made a simple certificate maker application using Adobe Flash & action script for calculations, that has 2 frames which takes input from user, eg. on frame1, it takes basic information like name, address, phone number etc. then user click next button to navigate on 2nd frame, then it takes some numerical data, like marks in some subjects for first, second and third terminal examinations and again pressing the next button navigates the user to 3rd frame which shows the final certificate after some calculations on numerical data to calculate grades and cumulative percentages. Since this is an swf movie, I right click on the final result and print it.. There is no mechanism to save it for future re-printing/viewing (read-only). I was thinking to give a button for save that could convert the final output with a background image & some dynamic fields to pdf or png. How can I do it?

Use AlivePDF, you can find it here:
http://alivepdf.bytearray.org/
Example code how to use it can be viewed here
http://snipplr.com/view/45819/

Related

Anchor base not working in uipath for pdf extraction

I want to extract certain text and numbers from a PDF invoice, one of which is the total amount. The thing is that the position of the total amount keeps on changing from pdf to pdf based on how many number of items are there. If there are lot of item then the total amount field will be lower in the pdf and if the number of items are less then the total amount will be higher up in the pdf. See below image for ref. There are only 2 items in the invoice so the total field is at a higher position. But I also have invoices where there are 15 items in the invoice and the total field is either lower in the page or is in the next page.
How do I extract it then? I tried using Anchor base but it is not working!
This is the work I have done till now:
1.) Assign a for loop to open each and every pdf in the folder one by one.
2.) for each pdf, I have assigned a hot key which fits one full page to the window.
3.) Then I am using Anchor Base (total in the image f=given below is the anchor and the amount is the value to be extracted).
4.) Using a message box to print the value
5.) close the pdf
Two potential solutions.
Use UiPath Document Understanding
You can get a certain amount of DU Data on the Community License, then you can setup the templates and use anchor bases, token selection, custom area selectors etc.
Read Lines Approach
Convert the PDF to Text.
Have a look through the extracted Text and find a phrase/keyword that you could use as your anchor. Going by your example you might you "Total: "
Then use Invoke Code (I'll use C# for below example)
Arguments: in_text (the text from the PDF) | out_totalAmount
Code:
var invoiceTotal = File.ReadLines(in_text).Last(e => e.StartsWith("Total: ")).Trim();
out_totalAmount = invoiceTotal.Split(new []{":"}).LastOrDefault();

How do I get the user's input from a .html file to a .c file?

I'm trying to get the input from my html webpage, which has a text box and submit button. How can I get the user's input in a separate .c file, so that I can change what happens in my html file depending on the input?
Here is the problem for my assignment:
If the player input the word NORTH, SOUTH, EAST, or WEST, the program will programmatically generate a webpage that hyperlinks to another room. Do printf() to the browser.
You will need to do something like this:
printf(“< a href=\”http://URL\”>Press HERE to go North< /a>”);
The above printf() will display on the browser a hyperlink. The player will simply click on the word Press HERE to go North with their mouse to cause the browser to change to another webpage. The HTML tag to link to another webpage is:
< a href=”URL”>TEXT TO CLICK< /a>.
You will need to do this for each direction: NORTH, SOUTH, EAST and WEST. If the player input the word GOLD, the program will programmatically generate a webpage that displays the amount of gold pieces the player currently owns and a hyperlink to return the player back to the current room.
Might need a little bit more clarification on what exactly it is you're trying to achieve, but if you do actually want the HTML file to change based on the user's input, depending on whether you want that change to be permanent or based on the individual user, you have a couple of options:
1) If you want the user's input to permanently change the HTML file, have it posted to another server-side page on your website (PHP for example) -- then take the user's input and you can use PHP to write actual changes to the HTML file stored on the server which is delivered to your end users. I would advise being very careful with this and make sure you sanitise the input properly to avoid security issues.
2) Alternatively if you want the user's input to change the page they're viewing in some way in real-time and only for that user, you probably want to make use of JavaScript and set the innerHTML of elements based on the user's input.
If you clarify a little more in the comments for this answer what exactly you're trying to achieve, I can give more specific help.

MS Access Form from Paper Form

I have taken over an MS Access database that was created by an employee that has moved on. It appears that he has created a form in the database by importing a paper form that is used within our company. What makes me believe that he imported a paper form is the exactness of Access form in relation to the paper form.
I am not sure how to ask query this using Google nor Bing. Can someone point me in the right direction on how to do this, please? I need to do the same thing with another paper form.
Yes, June7 is right, this is a handy technique.
Scan your paper document as JPG or PNG
Create a blank Access Form, and from the Design ribbon menu, choose "Insert Image" and select your newly created JPG or PNG scan
For the image object, check the properties window and make sure the "Sizing Mode" is set to Clip (and not Stretch or Zoom)
Now re-size the Image on your form so you can see everything correctly.
Now add Text boxes on top of the image, to create fillable text fields, exactly over the same place as the ones in the scanned image behind your text boxes.
You can then make a Table with the same field names, and update the Form to use this Table as it's Data Source on the Data Tab of the Form properties.
Once you have the form working perfectly nicely,
a handy time-staving step is File -> Save Object As -> change the Form dropdown to Report
Now you have created a Report that is printable using the same data table you created earlier (and write macro or VBA code make sure you print only one record at a time if that is the normal behaviour you expect)

How to find same logos, UI elements using sikulix

I am new to sikuli.
I am using it for functional test automation of my java spring standalone application. I am having the same set of images(logos) at multiple locations on the screen. and they are generated dynamically as per the application data. In that case how can I find and click on certain buttons/elements in the UI.
Example: like, share, comment text/image will be there several times in facebook page. in that how to we click on particular buttons out of all.(facebook is just an example) i want the similar solution for my application.
I think what you're asking is- given a case where the same image or UI element is present multiple times on the same page, how can I specify one of these elements in one location versus the same element in another?
The quick and easy way to do this would be to capture a larger picture, like as much of the window as you can, and click the image in parentheses after the click action; this opens a window reading file, matching preview, and target offset. Click target offset, use the mouse wheel to zoom in, and click on the exact point of the picture that you'd like to click.
It's possible to click in multiple places on a captured image, provided you use different click() commands, and you can set the target offset for each click() command without needing a new picture.
With just this one image, you can potentially click every square on the board provided you take the time to set the offset for each of the 64 click() commands it'd take to do so. http://files.chesscomfiles.com/images_users/tiny_mce/cigoL/Chessboard.png
The more difficult solution would be setting up regions, and searching those regions for the matching pictures, but for what you're looking for this should- for more about regions and setting it up check links below. Cheers!
http://sikulix-2014.readthedocs.io/en/latest/index.html
Based on your FB example you could use setROI() to focus on the top post on the page (imagine a rectangle that covers a complete post on the news feed) from there I would loop:
if exists(profile pic):
click(like button)
elif exists(profile pic 2): # If you are testing more than one user
click(like button)
else : type(Key.DOWN) #repeat as needed
Getting the next post into the ROI may be tricky but using WHEEL_DOWN may help if you can adjust your lines traveled with each wheel click on your system.

click through several links on webpage and extract information from each?

I have access a webpage with a list of several hyperlinks, each of which are unique. This is it:
webpage I have access to that lists names from top to bottom. Each name is unique and is a hyperlink. I would like to click on these hyperlinks one by one and extract info from the resulting webpage.
Say I click the first name, say Adam, it then brings me to the following webpage:
alt:this is a page of the user's profile and includes info such as name, email status and more
My goal is to create a program that clicks the name at the top, and then takes the email address and puts it in an excel spreadsheet on my local machine. And then goes back to the original page, clicks on the name directly below the name that was previously clicked on, and then takes this names resulting email and throws it in the spreadsheet.
for those looking at the pictures, i would like to click on 'Adam' and then put his email into a spreadsheet, then go back, and then click on 'Adrian' and then put his email into a spreadsheet, and so on and so forth down the list.
What do I need to do/learn to create a tool that will do this for me?
I know a bit of Java and a tiny bit of html. I've been trying to look for a solution but the most I can get is excel vba to click on the first name, but not much more. Even if I got the vba to click on all the names, it seems I would have to type in an instruction for the vba to find each unique name, and I dont see much point in doing that since its probably faster to just do this manually then.
As i'm not a programmer (but would like to be soon :)) I have had some trouble asking this question since I don't know any technical terms.
Any thoughts/advice on how to do this?
With javascript and a little php you could make this happen. Since it appears this is something running in the browser it would probably be your best bet.
Make your program click links js has the ability to activate links. You could
click on body load
the first link on the page,
then have a counter that counts each time you click a link.
`Find out how many links there are in the document:`
var x = document.links.length;`
`Get the URL of the first link (index 0) in the document:`
`var x = document.links[0].href;`
Click the link you want to click
$(function(){
$('#myLink').trigger('click');
})
now that your on the next page you need to grab the email address that is on this page. If you know the css just grab the string that is in the element. at this point you can use javascript to go back to the previous page.
<button onclick="goBack()">Go Back</button>
Now you are on the original page. Your counter is one number higher. Use the counter to click the next link and your program will repeat the process pushing the new email to your array.
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Kiwi");
once the program runs out of links to click or hits the limit of your counter you will need to create a txt file with javascript. write your array to the file with PHP. You can do this with an ajax call.
make an AJAX call to your php file passing the array. php can then write to the file.
Here is an example of making a text file and writing to it with javascript
Following this logic you can fairly easy make an application that activates the links in order of a page, pushes the email address to an array as a string. Goes back to the previous page and continues the process till you have all the links. At this point your program will write all the data in the array to a file.