• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 395
  • Last Modified:

Awesome powers of pdf content manipulation... (how to move content around in a pdf file)

(Follow-on to http://www.experts-exchange.com/Web/Graphics/Adobe_Acrobat/Q_21415298.html)

Hello fellow experts

I now have Adobe Acrobat 7 Try-Out, with a .pdf file that I have created opened, and am able to create form fields programmatically using Access and VB.NET and the Adobe Acrobat 7.0 Type Library.

I have a 'table-like' area in my report that has column headers and five rows.  I'd like to place a button on the right side of each row (I figured this part out), and if clicked, slide the conents of the pdf down about a half an inch, and create a form field that allows the user to enter text (notes).

Is this possible?

TIA
-Jim
0
Jim Horn
Asked:
Jim Horn
  • 7
  • 6
  • 5
1 Solution
 
Karl Heinz KremerCommented:
No. You don't have access to "real" PDF content from the forms interface. If you can live with actually moving the complete page content by half an inch, you can play tricks with the crop box. How many items are we talking about? You may be able to do everything as form fields. This way, you can move all the content as much as you like (and you would also know exactly where the data is). This is one of the options that I suggested in your first question.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
>you can play tricks with the crop box
I'd need some more details on this one...

>How many items are we talking about?
Six columns, probably 5-8 rows, and I'm thinking about having a single form field below each row, that is the width of the page, for notes.
0
 
Karl Heinz KremerCommented:
So we are talking about 30 to 48 fields. That's not too complicated to do on the fly: Instead of printing the whole form, just take either a blank page (which of course you can create with the Acrobat API), or a template and then just create the form fields on the page, fill in the data, flatten the document, and then create the form fields that should remain interactive.

Regarding the shifting of page content: Try the following JavaScript in the debugger. For that, type Ctrl-J. This will open the JavaScript debugger. Open a test document. Paste the following lines into this window:

var mediaRect= this.getPageBox("Media");
mediaRect[1] +=72;
mediaRect[3] +=72;
this.setPageBoxes("Media", 0, 0, mediaRect);

Select the four lines and use the "Enter" key on the numeric keypad (_NOT_ the normal Enter key, this will not work). Does your page content shift?
To really make this useful, you have to modify both the media box and the crop box, and potentially other page boxes.

And just in case it's not clear yet :-) You can also do this from within your VBA program.

You can actually shift the content back and restore the original page: Just replace the += with -= in both lines, select the four lines again and use the "ENter" key on the numeric keypad.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
jjafferrCommented:
Hi jim / khkremer

I have the full Adobe Acrobat installed, but Access cannot see "Adobe Acrobat 7.0 Type Library" as a reference,
could you please tell me where to find it.

Thanks

jaffer
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
It shows up in my Tools:References.  Also, (potentially stupid comment) make sure you installed Adobe Acrobat Professional and not Reader.
0
 
jjafferrCommented:
I have the professional installed, but still it doesn't show in my VB Tools>Reference!

What is the path of the file, maybe I can browes and make a Reference that way.

Thanks jim

jaffer
0
 
Karl Heinz KremerCommented:
jaffer, if you have a problem, you should open your own question.

Select "Add Reference", then select the "COM" tab, the Adobe type library should be listed on this tab.
0
 
jjafferrCommented:
Yes Sir khkremer,

I just thought if an Access Sage can communicate P2P with another Access Sage, then it would be all right ;o)

I am using Access.

jaffer
0
 
Karl Heinz KremerCommented:
In this case the Acrobat Sage will admit that I should have checked your track record :-)
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Hey there, stop freeloading on my question, and get your own.. :)
0
 
jjafferrCommented:
Well guys, Now that we are clear, how about an answer?

I was going to ask on how to convert pdf pages to jpg too (I have seen Jim's question somewhere, but couldn't implement it, as it was VB.net instead of VB).

jaffer
0
 
Karl Heinz KremerCommented:
The file is (if you used the default install path) here: C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.tlb
0
 
Karl Heinz KremerCommented:
VB vs. VB.NET should not matter if you are using the Acrobat JSObject.
0
 
jjafferrCommented:
I selected C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.tlb

but I only get "Acrobat" in the reference, not "Adobe Acrobat 7.0 Type Library"

I am on winXp with Access2003

I guess the code didn't work ealier due to the reference,
Now I am looking for the code again.

jaffer
0
 
jjafferrCommented:
0
 
Karl Heinz KremerCommented:
Jim, how's the moving of PDF content going?
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Sorry, the current client shifted into 'help me look good for a presentation' mode, and I have been temporarily diverted.  I'll respond back when I get back on track and acquire the ability to converse coherently about this.  -Jim
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Sorry for the delay.  Thanks for all your help here.  -Jim
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 7
  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now