iText create pushbutton at relative position - pdf

I'd like to create a pushbutton on a pdf using iText. However i cannot create it at any fixed/ position. It needs to be done at a relative position. Like say, 5-6 cm. before end of PDF.
Any idea on how to do it?
Another way might be creating an invisible field in acrobat, getting its field position and then creating the button at that position. However i've been unable to retrieve field positions or even view them. Could someone help me with this?
Regards,
Sameer

you should always know the size of your pages, and if you know that you will be able to put it at a relative 5-6cm of the page. some info that might help you is that all the coor and stuff in itext is done in points and there are 72pts in an inch.

Related

Where do I find the field that determines whether a PDF has or is a fillable form or a scanned image?

A very quick question but I am at wits end trying to find it so I hope someone might have crossed this path. I have thousands of PDF's and need to know which of them are fillable forms or scanned images. I know I have seen a field that shows form : Acroform or something to that effect. Might this be in the info dictionary or do I need to go the XMP route? Is this the same location I might be able to tell if a PDF was a scanned image or page (I recognize that might have to be split into a separate question.
The goal is to loop through a series of pdfs and extract that data for a table.
Thank you

How can I set the line height of a multi-line PDF form field, and save it so it doesn't get reset by filling it?

I am having the exact same issue described in this question: Multiline pdf text box
I have a PDF that has some dotted lines that I want to convert into a fillable multi-line field. I tried the solution in the linked question, but my setting is not staying when I try to fill in the field outside of Acrobat.
When I am preparing the form inside Acrobat, I set the line height to 30 and it is lining up fine:
But when I save this PDF and then try to fill in the field outside of Acrobat, the line height setting does not stay. It gets reset every time:
It's super frustrating and I have scoured the internet looking for an answer but I have nothing yet. If someone knows what to do to get the line height looking like the first screenshot, please save my sanity.
I'm using Adobe Acrobat Pro DC 2021.001.20135 on macOS 10.14.6.
Thank you
You can't. Those settings don't "stick" when the field is cleared and there's no way to set them programmatically. It's best to simply remove the lines from the PDF.
As #joelgeraci stated, the settings don't stick.
However, if the form has to be manually fillable, removing the writing lines may not be the best idea. In this situation, it would be better to change the field's background color. When the field has no content, its background color is transparent, otherwise white. And that will cover the writing lines.

How to add floating button in PDF?

I would like to add a floating button in PDF. However, after doing a lot research on internet, I didn't find any answers.
I would like the button to float/move across the pages with the scroll bar as the document is scrolled. Is there a way to implement it in PDF?
Note: I would prefer to not to use JavaScript to implement it.
Thanks in advance.
As #mkl commented, it is not possible to add a floating button in PDF without using JavaScript.
PDF is meant to be used for fixed layout and not dynamically change as it is being viewed.
The closest I could find to what you are looking to do is this article about creating text that shows/hides depending on where the cursor is. I can't think of a way to leverage this though to change the position of a button as a user scrolls and even then you would most likely run into different PDF viewers handling it differently.

Extract screenshot or picture of portion of PDF using VBA or VB and Adobe SDK

I am currently using an excel macro (although I will switch to VB.NET if necessary) to loop through all of the text in a PDF and populate an array with certain portions of the text in the PDF (via the Adobe SDK and getPageNthWord). This part is working just fine, but now what I want goes a step further.
There are certain portions of the PDF where just grabbing the text isn't giving the full picture, and I'd like to see what more I can get. This is exactly the screenshot or snippet I am trying to get:
So, I know that I could use getPageNthWordQuads to find the coordinates for the words "Compliance Warning" and I could figure out a way to find the bottom right of the screen as well, but my problem starts there. After I get those coordinates what would I do with them? Can I zoom in the PDF to only see that portion and then take a screenshot? I already have the code for a screenshot of the activewindow, but I don't know how to scroll or zoom on a PDF.
Any help would be greatly appreciated. A fresh approach would be welcome as well. Thanks!
There are probably a number of approaches that would work - I don't know enough about your environment / constraints to know for sure which would work best. I'm assuming you are talking to Acrobat through OLE here.
1) You can open a window, get its AVPageView and ask it to zoom and move to where you want it to do your thing.
2) You can open a PDF document in one of your own windows using OpenInWindowEx and then grab the contents of that window (the advantage being that this window could be off screen).
3) You can use the DrawEx method (in AcroExch.PDPage) to render a specific portion of a page into your own window and then process that.

can any one tell me the details about below displayed control?can i arrange images on this?

can any one tell me the details about below displayed control?can i arrange images on this?
Hi all,
may i know the name of below displayed control.
how can create this.
can i able to arrange images or text box inside the control.
Hi all,
can any one help me .
can any one provide me any code to create this ,sample apps or paths to refer.
i need to arrange images on to this.
is it possible to do?
The control you are looking at is a UIPickerView. Apple documentation covers this pretty well. It is possible to assign images to it.