I'm pretty new to VB, but I've got a script working which involves taking a PDF with fillable fields, and populating a column in an xlsx with all of the field names.
I would like to take this a step further, and pull the field descriptions as well, into another column. By that, I mean the description which comes up when mousing over a particular field in the form. Getting the name of the field is easy enough, but I've done some digging and am not sure if it's possible to pull the description as easily.
I've experimented with functions similar to "object.getNthFieldName(x)," but no such luck.
Not entirely sure if this is possible, but looking for any insight. Thanks!
Related
Can I somehow import a table from pdf to a UiPath DataTable?
I can do it via loading it to a string array and after that splitting it. But I hope so there is a better and more safe solution to get a table from PDF.
The easiest way is to use the Read PDF Text activity.
As it's often changing, it does really make sense to give you a tutorial here about how you add it to UiPath and what parameters you currently have. Overall all info you can find on the official detailed tutorial.
Basically this activity gives you the easy way of extracting data and managing it.
If the result is not okay you will need to switch to the OCR activity with nearly the same name. This one reads the data visually. But from what you gave here, I would not recommend you that.
There are many other activities out there, like extracting it into an Excel Workbook. So simply try out what you need.
I have a pdf. The xfa:datasets node looks like this:
<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"><xfa:data xfa:dataNode="dataGroup" /></xfa:datasets>
Thus I can extract no information about the underlying schema, so I can't generate xml to fill this.
the pdf uses javascript to add rows to the tables, in the following manner:
this.resolveNode('document_table.Table3._user_input').addInstance(1);
using iTextSharp in the Xfa.TemplateSom, I can find references to the form elements. In the DomDocument I can search and find the various elements in the xml, but this is where I'm stuck. There seems to be no relationship to the XFA data, I tried the XFA Worker demo and the demo confirmed the pdf has no XFA data.
I'm unsure what type of form this is if it's not XFA and not AcroFields.
Bruno, I bought your book and while I haven't read it cover to cover, it doesn't cover this scenario so far as I can tell. Any insight anyone has on how this type of form can be filled, I would appreciate it.
Right now, I'm wondering if I have to append javascript which mimicks the actions and sets the data. Since there are many forms, each with a different layout, parsing through all of them manually to get the hierarchy and replicate the javascript on my own is onerous and frankly I'm not sure this approach will be successful.
The form is an XFA form, and the fact that the DataDescription is missing is a pity, but it's not abnormal. The description of the data is optional, not mandatory.
If it's your intention to fill the form with iText, then you should forget about JavaScript to add rows. You should not confuse manual data entry —where a user enters the data row by row, adding rows manually— with automated data entry —where you provide data in the form of an XML file. If you have a table with rows, then those rows will be populated with as many rows as there are data rows in your source XML.
The real question is: How do you compose that XML if there is no data description?
There's the ideal way: you ask the person who created the form for the schema of the data. He or she provided a data source when creating the form, so he or she knows how the data should be organized in the XML. Unfortunately, you don't always have access to the people who created the form.
There's the hard way: you examine the XFA XML, and you look at the data bindings in the template. I would need the XFA spec if I was given that task; I wouldn't know where to start if someone asked me off the cuff.
There's the pragmatic way: this is the workaround I always use. I fill out the form manually in Adobe Acrobat. I fill out every possible field, and then I save the filled out form. Then I extract the data XML. I use that data XML to create an XSD (there are tools for that). This gives me an approximation of the data description that is expected by the XFA form. Obviously, this XSD won't be perfect because it might not catch all the rules and restrictions that were added to the form, but in most of the cases I encountered, this was sufficient (and when it wasn't sufficient, some minor tweaks to the XSD did the trick).
Once you know the expected structure of the XML, you shouldn't have to worry about JavaScript. The JavaScript that is there to deal with user actions is irrelevant in the context of automatic form filling. The only JavaScript that matters in the context of filling an XFA form with iText, is the JavaScript that does automatic formatting of data (e.g. format a date, a currency,...).
I need to scrape the data from this page into a table format. To give you an idea, Here is what it looks like :
I want to see there is a way to bring this data into a table format using VBA script in excel. I can write a VBA code to do this by trimming the information into small pieces and placing it in particular cells.
I believe that's not the most efficient way and something tells me there is probably a better method out there that I just don't know off yet. Hence, I am reaching out here.
I wanted to see if you guys know of a method to do this better than trimming and pasting.
The data is in JSON format. You have to parse it and then decide in what way you want to present the data in Excel.
Here it is informacion about that:
I am in the process of creating a program, using Visual Basic Express, for a physics professor who has recently had to rename all 1500 questions for his course. I created a database that has the old names, new names, and the entire contents of each question. The program seemed an easy enough idea, but has proved to be very difficult for me. I am new to programming (this is only my third go at it) and have searched for an answer to my problem for at least 20 hours, and have yet to find anything that will work for what I need.
What I would like is to have a text box in which he can type in a keyword (such as "Sun", "ISS", "Force", etc) and for the program to search throughout the entire "questioncontents" column and pull out any questions that contain those words into the datagrid. As of yet the closest I have gotten is for it to search the first word of the column, which is not very useful since most of them start with "The".
I had also thought of creating several keyword columns and then just having it search through those, but I couldn't figure out how to apply the filter to multiple columns.
This may be a stupid question, and if so I apologize, but I am desperate to figure this out as the semester begins relatively soon and I would like to show him how to use it before classes start. Any suggestions or help would be very greatly appreciated.
According to my understanding of the question:
SELECT * FROM question WHERE questioncontent LIKE '%SUN%';
As simple as that, you just have to replace SUN in the above query with the value entered in the textbox
i have a report which looks like this. it will be in PDF format:
alt text http://img52.imageshack.us/img52/3324/fullscreencapture121420.png
the user will input all the different foods, thus every section like NONE, MODERATE, SEVERE will be a different size and thus i need to be able to expand the sections during run time. in order to do that i should probably slice up the image and add different sections during run time. i dont know the proper way to do it.
please help me with a suggestion on how to go about fitting the text in the appropriate sections (but also keep in mind i have no control over how many foods are in each section, the user will decide this during run time)
I would create an iTextSharp table for each of your results (None, Moderate, Severe) and write out the table sequentially, in the order you want them to appear on your PDF. Each row in your tables would have four columns.
I found these articles useful for creating tables in iTextSharp:
iTextSharp - Introducing Tables
SourceForge Table Tutorial
Edit
Sorry, I didn't see the vb.net tag on your question. The pages I linked are in C# - I hope you can translate. I found that most of the iTextSharp samples you'll find are in C#.
It might be worth using a reporting tool rather than iTextSharp for formatted/tabular data?
We use Active Reports from http://www.datadynamics.com/ but I am sure there are others.
EDIT:
It looks like iTextSharp supports html-to-pdf conversion? Maybe thats easier to render?
Just did a search and found this: http://somewebguy.wordpress.com/2009/05/08/itextsharp-simplify-your-html-to-pdf-creation/