itextsharp: how to move the datatable? - vb.net

as you can see my data table is a little too much on the right, how do i move it more to the left? please include answer in vb.net
alt text http://img38.imageshack.us/img38/3661/fullscreencapture121520.png

If you're using a PdfPTable you can explicitly set the position of the table using the table's WriteSelectedRows() method.
Here's a C# example
Documentation on WriteSelectedRows (such as it exists) can be found at the sourceforge tutorial.
The links I provided are in C#. I've seen very little iTextSharp code in VB.NET but ran this class through the DeveloperFusion C# to VB.NET converter and results looked good to me. If you haven't already, you might want to bookmark the DeveloperFusion converter site.

You probably just need to adjust the margins. i'm guessing you're looking at the default.
Here's a simple iTextSharp example that shows how to manipulate margins.

Related

Highlight words in a PDF using PDFBox 1.8.9 and VB Net

I am trying to Highlight words in a PDF using PDFBox 1.8.9 and VB Net.
I have a list of words which I need to highlight in a pdf. I don't know their locations, I just have a list.
I am trying to use PDFBox as the library to help me but every reference I have found points to Java which I have no experience with.
I am using PDFBox to parse the text and annotations, but am really struggling with the highlighting.
I know this probably seems like old ground that has been covered before. But as I said, every reference I had found points to Java. I have been trying for over 3 weeks to get this to work, with no success!
I have tried iTextSharp, Acrobat.tlb with mixed success but really want to get this to work with PDFBox.
Thanks.

Create variants of a document with corresponding labels for AI training

I am looking for an easy solution for the following problem:
I have to create variants of a document and export them as an image. This could be easily done with the MS Word Mail Merge, but I need the pixel positions of every text block in that document. The image as well as the pixel positions are input for an AI training.
At the moment I can think of several approaches:
Throw the MS Word Mail Merge output into an OCR and try to identify the positions of the text blocks by comparing them with the original text source.
Create the document with something like JS, Python or Visual Basic and save the exact positions of each inserted text block at the time of inserting.
Maybe use Visual Basic for Word to extract the text positions from the MS Word XML file that was created with the Mail Merge function.
Variant 1 seems to be overly complicated because it uses some kind of reverse engineering. Additionally, using an OCR even on a perfectly readible document can always be a source of error.
So variants 2 or 3 seem fine, but I don't know any libraries that fit the requirements and Visual Basic for Word is absolutely new territory for me.
I hope I described the problem well enough. If you want me to clarify something, please let me know.
I appreciate every idea and help! :)
Best Regards
Henrik
Seems like someone already dislikes my post. Please let me know how I can improve before voting me down..
Anyway, I may have found a way to realize variant 2. This stackoverflow post references a Github Gist that extends the Python Image Library. It offers a function to write text on an image and also set a maximum width for the text box. The function also returns the final width and height of the drawn text box. Using this I will try to implement an algorithm that creates the document images as well as the label files.
Maybe this will also help someone else looking for the same thing.

Create slideshow from text

I would like to read text from 3 text paragraphs & use the text to create a slideshow of 3 slides - each with a paragraph programatically.
Is it possible? Do I need to use openoffice, libreoffice or something else?
I have googled a lot, but could not find any answer. Hence, posting the question on SO.
Thanks.
Openoffice has a bridge called Uno which can be used from python, java (and probably more), i.e. you can manipulate openoffice documents from an external program, it's however non-trivial to use it.
Another possibility is to use OpenOffice.org BASIC.

Silverlight 4 RichtTextBox - how do I get the text without the formatting?

How do I get the text out of a Silverlight 4 RichTextBox without the formatting? I know the Xaml property will give me the XAML but I just want the text.
This is a little late, but I will post anyway. There is a trick that involves selecting all the text in code and then accessing the Text propety of the TextSelection object. Like so:
myRichTextBox.SelectAll();
var plainText = myRichTextBox.Selection.Text;
I am using it in my apps and although it is not the prettiest solution, it works. Found it here:
http://forums.silverlight.net/forums/p/184560/422007.aspx
If you just want text, why not use TextBox instead?
There are various third-party components that support this kind of functionality (unfortunately paid). For example, Telerik's RadRichTextBox supports both highlighting and exporting rich text content as plain text, latter trough component called TxtFormatProvider.

VB.NET - New text editor? (Syntax Highlighting and Syntax Extraction)

I'm thinking of developing a more efficient version of the Rich Text format but I need to know a little about Syntax Highlighting and Syntax Extraction.
Like when reading the file, read all the {Property Boxes} and use them in a RichTextBox.
Ex:
{C=0000FF}Hello world!{/C}
Prints "Hello world!" in red.
This would also be good to figure out because I am also building acode editor for a very simple version of Python and color codded text would make things easier and seems pretty standard.
There's a codeproject article about this called Syntax highlighting textbox written in C# which might give you some pointers.
And in case you're going to use a RichTextBox I'd suggest this blog post Some RichTextBox tricks .
It might be worth trying to get hold of the book Dissecting a C# Application: Inside SharpDevelop which has a chapter called Chapter 9: Syntax Highlighting (quite old book but might be able to get a second hand copy).