Page Headings

J

Jay Bukstein

Is there a way in VBA code to determine when Page Break
is going to occur?

I'm trying to control the printing of some page heading
information. This information is text that is set with
form fields from an ADO database connection. MS doesn't
allow form fields in the header section of a document.
 
J

Jonathan West

It is possible to work out where the page breaks are - for instance the
\Page predefined bookmark covers the page containing the current selection.

But is there ary reason why the data from the database connection must be
inserted only in formfields?
 
J

JGM

Hi Jonathan,

Well, maybe you can answer my question here, for the benefits of others at
the same time...!

Situation:
Document A has a bookmarked hyperlink pointing to a bookmark in Document B,
which points back to the bookmark of origin in Document A through a
hyperlink.
Makes any sense so far?

Now, I convert these document to PDF making sure to set the "keep hyperlink"
option checked.

Question:
If I leave it like that, once in the PDF format, all the hyperlink work, but
they point to the Word documents...
I can cheat by creating the hyperlink in Word to point to PDF documents by
changing the ".doc" extension n the field code to ".pdf" (Because my PDF
will have exactly the same name as the Word doc...)
So far so good, the hyperlinks work well in PDF format, BUT, I have lost the
bookmark functionality. The Hyperlinks bring me to the first page of the PDF
document, not to the original bookmarked location as set in Word.

So, is there a way to "automatically" convert this situation so that it will
work in PDF format. I know how to do this manually in Acrobat Writer, but I
will have to manage thousands of links, I don't want to do this manually!

Thanks.
 
J

Jonathan West

JGM said:
Hi Jonathan,

Well, maybe you can answer my question here, for the benefits of others at
the same time...!

Situation:
Document A has a bookmarked hyperlink pointing to a bookmark in Document B,
which points back to the bookmark of origin in Document A through a
hyperlink.
Makes any sense so far?

Now, I convert these document to PDF making sure to set the "keep hyperlink"
option checked.

Question:
If I leave it like that, once in the PDF format, all the hyperlink work, but
they point to the Word documents...
I can cheat by creating the hyperlink in Word to point to PDF documents by
changing the ".doc" extension n the field code to ".pdf" (Because my PDF
will have exactly the same name as the Word doc...)
So far so good, the hyperlinks work well in PDF format, BUT, I have lost the
bookmark functionality. The Hyperlinks bring me to the first page of the PDF
document, not to the original bookmarked location as set in Word.

So, is there a way to "automatically" convert this situation so that it will
work in PDF format. I know how to do this manually in Acrobat Writer, but I
will have to manage thousands of links, I don't want to do this manually!

When converting to PDF, MultiLinker does automatically convert hyperlinks
between documents so that the links in the converted file point to the
converted PDF destination file. In other words, the target of the link is
given a PDF extension instead of a doc extension.

It is something of a mystery to me why Adobe didn't do the same with the
PDFMaker add-in.
 
J

JGM

Hi Jonathan,

I agree with you about the seemingly stupid oversight on Adobe's part...

But how about the bookmark destination in the target document that Word
allows in an hyperlink field, just as Adobe allows with its link tool.

Anyway of getting Adobe to "read" the bookmarked destination as set in Word?
Is it possible or do I have to settle for the first page of the document as
a default "point of arrival" in the targeted document?

Thanks.
 
J

Jonathan West

JGM said:
Hi Jonathan,

I agree with you about the seemingly stupid oversight on Adobe's part...

But how about the bookmark destination in the target document that Word
allows in an hyperlink field, just as Adobe allows with its link tool.

Anyway of getting Adobe to "read" the bookmarked destination as set in Word?
Is it possible or do I have to settle for the first page of the document as
a default "point of arrival" in the targeted document?


Yes, Multilinker converts those kinds of links correctly, so that a link to
a bookmark of a Word document will go to the same point in the PDF when both
the source & target documents are converted.
 
J

JGM

Hi Jonathan,

Thanks for letting me now that it was possible.

I had a look-see on the Internet and found what I needed.
I will be able to automatically generate the proper PRINT fields with the
pdfmark in them so that my client's document will be to his taste.

I am sure that MultiLinker would be better than what I am coming up with,
but I am on a tight deadline and cannot afford to learn a new application
and, most of all., I do not think my client will be happy if I show up with
a new application for him to learn... (and pay for!). Theses links really
have to "magically" generate themselves based on a selected text and a
information contained in a database...

Can I pester you with one more question:

I am creating a macro that will look in a folder, pick up all the ".doc"
files, open them one by one to generate a PDF file. The problem is the
?/$$%/? dialog box that shows up to ask for the file name. If I uncheck the
"ask for file name" in the Distiller options, it works only if I use the
Distiller printer. But I need to use the Run.PDFMaker.ConvertToPDF macro as
part of my routine so that my TOC and Headings are automatically converted
in links and bookmarks.
The strange thing is that the PDF macro uses the Distiller printer, but
seems to disregard the seetings in the Option dialog...

Any ways of not having this dialog and let Acrobat name the PDF files based
on the Word names automatically?

Thanks.
 
J

Jonathan West

JGM said:
Hi Jonathan,
I am creating a macro that will look in a folder, pick up all the ".doc"
files, open them one by one to generate a PDF file. The problem is the
?/$$%/? dialog box that shows up to ask for the file name. If I uncheck the
"ask for file name" in the Distiller options, it works only if I use the
Distiller printer. But I need to use the Run.PDFMaker.ConvertToPDF macro as
part of my routine so that my TOC and Headings are automatically converted
in links and bookmarks.
The strange thing is that the PDF macro uses the Distiller printer, but
seems to disregard the seetings in the Option dialog...

Any ways of not having this dialog and let Acrobat name the PDF files based
on the Word names automatically?

Yes. If you have Acrobat 6, select the "Change Conversion settings" item in
the Adobe PDF menu in Word, and on the Settings tab of the dialog, uncheck
"Prompt for Adobe PDF File name"
 
J

JGM

Hi Jonathan,

So if I read between the lines correctly [ ;-) ], with Acrobat 5 I am up
the creek....

Either I live with this annoyance or I try to rewrite the ConvertToPDF macro
from Acrobat!

Ok, Thanks again!
Cheers!
 
J

Jonathan West

JGM said:
Hi Jonathan,

So if I read between the lines correctly [ ;-) ], with Acrobat 5 I am up
the creek....

Either I live with this annoyance or I try to rewrite the ConvertToPDF macro
from Acrobat!

I don't have a copy of Acrobat 5 to hand, so I don't know whether the same
setting is available there.
 
J

JGM

Hi Jonathan,

Just when I was very proud of having achieved all that I wanted in just less
than a day... something came up!

I talked to my client and learned that he has not yet purchased Acrobat. So
he is going to get Acrobat 6. I tought to myself: "I'd better get it too!"
So I did. Uninstalled 5 and put in 6. Ran my batch macro and it worked
flawlessly, including the skipping of asking the name for each file... Just
as you said it would.

Then I opened my new PDF files in my new Acrobat 6 and was amazed by all the
glitters! But not by the way it behaved! Bad boy!

Here it is:
I have source files that points to a ressource files that contains hundreds
of pages of definitions and descriptions that my client does not want in the
main text (the source files).
So in the ressourcs files, I have included, for example, the following
pdfmark:

{PRINT \p para "[ /Dest /My_Target_1 /View [ /FitB] /DEST pdfmark"}

and in the source file I point to that named destination with:

{PRINT \p para "[ /Rect [ wp$box pathbbox ] /Border [ 0 0 0 ] /Action /GoToR
/Dest /My_Target_1 /File (Pub/Fiche test.pdf) /Subtype /Link /ANN pdfmark"}

Everything worked under Acrobat 5, when I clicked on the source paragraph, I
was brought to the 3rd page of the ressource document (Where the named
destinataion given above is located).
Now it takes me to the document allright, but I am always stuck on the first
page. I have several named destination and all the links behave the same
way.

I tried changing all kinds of options in the Acrobat settings, to no avail.
I tried the Distiller options and this Word Compatibility option: “Use
Printer Metrics to Layout Document” . Actually, this last one had to be
checked with Acrobat 5, but with 6, if I uncheck it, it takes one of the
annotation an makes it "hot" on the whole page... so it still needs to be
checked with Acrobat 6.

Any clues as to what I am doing wrong?

Thanks.
--
_______________________________________
Jean-Guy Marcil
(e-mail address removed)

Jonathan West said:
JGM said:
Hi Jonathan,

So if I read between the lines correctly [ ;-) ], with Acrobat 5 I am up
the creek....

Either I live with this annoyance or I try to rewrite the ConvertToPDF macro
from Acrobat!

I don't have a copy of Acrobat 5 to hand, so I don't know whether the same
setting is available there.

--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup
 
J

Jonathan West

JGM said:
Hi Jonathan,

Just when I was very proud of having achieved all that I wanted in just less
than a day... something came up!

I talked to my client and learned that he has not yet purchased Acrobat. So
he is going to get Acrobat 6. I tought to myself: "I'd better get it too!"
So I did. Uninstalled 5 and put in 6. Ran my batch macro and it worked
flawlessly, including the skipping of asking the name for each file... Just
as you said it would.

Then I opened my new PDF files in my new Acrobat 6 and was amazed by all the
glitters! But not by the way it behaved! Bad boy!

Here it is:
I have source files that points to a ressource files that contains hundreds
of pages of definitions and descriptions that my client does not want in the
main text (the source files).
So in the ressourcs files, I have included, for example, the following
pdfmark:

{PRINT \p para "[ /Dest /My_Target_1 /View [ /FitB] /DEST pdfmark"}

and in the source file I point to that named destination with:

{PRINT \p para "[ /Rect [ wp$box pathbbox ] /Border [ 0 0 0 ] /Action /GoToR
/Dest /My_Target_1 /File (Pub/Fiche test.pdf) /Subtype /Link /ANN pdfmark"}

Everything worked under Acrobat 5, when I clicked on the source paragraph, I
was brought to the 3rd page of the ressource document (Where the named
destinataion given above is located).
Now it takes me to the document allright, but I am always stuck on the first
page. I have several named destination and all the links behave the same
way.

I tried changing all kinds of options in the Acrobat settings, to no avail.
I tried the Distiller options and this Word Compatibility option: “Use
Printer Metrics to Layout Document” . Actually, this last one had to be
checked with Acrobat 5, but with 6, if I uncheck it, it takes one of the
annotation an makes it "hot" on the whole page... so it still needs to be
checked with Acrobat 6.

Any clues as to what I am doing wrong?

Yes. Its quite simple, you have forgotton to include the /Page parameter in
your definition of a named destination. If your example is supposed to take
you to page 3, it should be as follows

{PRINT \p para "[ /Dest /My_Target_1 /Page 3 /View [ /FitB] /DEST pdfmark"}

In fact, I'm mildly surprised it worked even under Acrobat 5, and also
mildly surprised that the links were in the right place even if they were
pointing to the wrong page, because you have also left out the /SrcPg
parameter from the link definitions. I rather think that your link
definition should be as follows (assumes the link is on page 2 of the source
document)

{PRINT \p para "[ /SrcPg 2 /Rect [ wp$box pathbbox ] /Border [ 0 0 0 ]
/Action /GoToR /Dest /My_Target_1 /File (Pub/Fiche test.pdf) /Subtype /Link
/ANN pdfmark"}
 
J

JGM

Hi Jonathan, thanks for taking the time.

OK, I tried your suggestions, and same result.
Can you please tell me why the /Page key is necessary, Acrobat and 2 other
sources I consulted say it is optional, in fact here is the text from the
Acrobat 6 pdfmark reference manual:
"Page integer
(Optional) The sequence number of the destination page. If present,
the named destination pdfmark may be placed anywhere in the
PostScript language file. If omitted, the pdfmark must occur within
the PostScript language description for the destination page."

From what I understand, if I used the page key, I will make my named
detination bound to a page, which is what I am trying to avoid. I think the
Page key is useful if you want to store all the named destination codes in
one place, like at the beginning of the document. Also, like I said, I read
many documents on this, but I do not have your experience.. I hope you will
indulge me... I have not seen the SrcPg key anywhere. It is nowhere to be
found in the pdfmark manual. Where do you get more material on this, like
the [ wp$box pathbbox ] code, is there a list of these things somewhere?

Finally, I though I tried some tests, here are the results:
(All tested with the code I posted in the ealier post)
The files produced with Acrobat 6 work flawlessly under Acrobat 5.
The ones produced with 5 work as they should under 5. The same ones produced
with 5 do not work under 6, I mean everything is fine, except that the links
to named destinations do not work.

Just to make sure that it was not a "Named destination" problem, I tested
with absolute references using page # and the following pdfmark code:
{PRINT \p para "[ /Rect [ wp$box pathbbox ] /Border [ 0 0 1 ] /Action /GoToR
/File (Pub/Fiche test.pdf) /Page 5 /View [ /FitB ] /Subtype /Link /ANN
pdfmark"}

Same result.

Just to be certain, I did another test, I used the following code in Word
with Acrobat 6:
{PRINT \p para "[ /Rect [ wp$box pathbbox ] /Border [ 0 0 1 ] /Page 3
/Subtype /Link /ANN pdfmark"}

But this time it worked.

So, it seems that I can use pdfmark to generate links to other files, links
to other pages in the same file, but not links to specified (absolutre or
relative) location in another file.

What is going on? Is this a problem with the GoToR action or its parameters
at reading time under 6? Because the fle generated by Distiller works under
5. So the problem seems to lie with Acrobat 6 not being able to sort out the
destinations...

Sorry if this post is getting as long as a novel... but I just had a flash.

I tested creating links from within Acrobat to see where the problem m ight
be.
I had the same problem. I creatd a destination in a target document. Came
back to the source, linked it. And bang, no go! I still ended up on the
first page.
After fiddling with it I noticed that sometimes it worked. Finally, I got it
to work. If I create the links in Acrobat itself, I have to specify that the
link to the named destination in another document must be opened in a new
window. Otherwise I end up on the first page, regardless of the named
destination's position in the document.

So the question becomes:
How do I specify "Open destination inNew Window" in the following pdfmark
code:
{PRINT \p para "[ /Rect [ wp$box pathbbox ] /Border [ 0 0 0 ] /Action /GoToR
/Dest /My_Target_1 /File (Pub/Fiche test.pdf) /Subtype /Link /ANN pdfmark"}

TIA

--
_______________________________________
Jean-Guy Marcil
(e-mail address removed)

Jonathan West said:
JGM said:
Hi Jonathan,

Just when I was very proud of having achieved all that I wanted in just less
than a day... something came up!

I talked to my client and learned that he has not yet purchased Acrobat. So
he is going to get Acrobat 6. I tought to myself: "I'd better get it too!"
So I did. Uninstalled 5 and put in 6. Ran my batch macro and it worked
flawlessly, including the skipping of asking the name for each file... Just
as you said it would.

Then I opened my new PDF files in my new Acrobat 6 and was amazed by all the
glitters! But not by the way it behaved! Bad boy!

Here it is:
I have source files that points to a ressource files that contains hundreds
of pages of definitions and descriptions that my client does not want in the
main text (the source files).
So in the ressourcs files, I have included, for example, the following
pdfmark:

{PRINT \p para "[ /Dest /My_Target_1 /View [ /FitB] /DEST pdfmark"}

and in the source file I point to that named destination with:

{PRINT \p para "[ /Rect [ wp$box pathbbox ] /Border [ 0 0 0 ] /Action /GoToR
/Dest /My_Target_1 /File (Pub/Fiche test.pdf) /Subtype /Link /ANN pdfmark"}

Everything worked under Acrobat 5, when I clicked on the source
paragraph,
I
was brought to the 3rd page of the ressource document (Where the named
destinataion given above is located).
Now it takes me to the document allright, but I am always stuck on the first
page. I have several named destination and all the links behave the same
way.

I tried changing all kinds of options in the Acrobat settings, to no avail.
I tried the Distiller options and this Word Compatibility option: “Use
Printer Metrics to Layout Document” . Actually, this last one had to be
checked with Acrobat 5, but with 6, if I uncheck it, it takes one of the
annotation an makes it "hot" on the whole page... so it still needs to be
checked with Acrobat 6.

Any clues as to what I am doing wrong?

Yes. Its quite simple, you have forgotton to include the /Page parameter in
your definition of a named destination. If your example is supposed to take
you to page 3, it should be as follows

{PRINT \p para "[ /Dest /My_Target_1 /Page 3 /View [ /FitB] /DEST pdfmark"}

In fact, I'm mildly surprised it worked even under Acrobat 5, and also
mildly surprised that the links were in the right place even if they were
pointing to the wrong page, because you have also left out the /SrcPg
parameter from the link definitions. I rather think that your link
definition should be as follows (assumes the link is on page 2 of the source
document)

{PRINT \p para "[ /SrcPg 2 /Rect [ wp$box pathbbox ] /Border [ 0 0 0 ]
/Action /GoToR /Dest /My_Target_1 /File (Pub/Fiche test.pdf) /Subtype /Link
/ANN pdfmark"}


--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup
 
J

JGM

Hi Jonathan,

Did some more research...

See
http://www.adobeforums.com/cgi-bin/[email protected]@.1de9e258
for an "official" statement...

So, my final question remains:

Is there a pdfmark key to force the opening of a destination (with GoToR) in
a new window?

TIA
--
_______________________________________
Jean-Guy Marcil
(e-mail address removed)

Jonathan West said:
JGM said:
Hi Jonathan,

Just when I was very proud of having achieved all that I wanted in just less
than a day... something came up!

I talked to my client and learned that he has not yet purchased Acrobat. So
he is going to get Acrobat 6. I tought to myself: "I'd better get it too!"
So I did. Uninstalled 5 and put in 6. Ran my batch macro and it worked
flawlessly, including the skipping of asking the name for each file... Just
as you said it would.

Then I opened my new PDF files in my new Acrobat 6 and was amazed by all the
glitters! But not by the way it behaved! Bad boy!

Here it is:
I have source files that points to a ressource files that contains hundreds
of pages of definitions and descriptions that my client does not want in the
main text (the source files).
So in the ressourcs files, I have included, for example, the following
pdfmark:

{PRINT \p para "[ /Dest /My_Target_1 /View [ /FitB] /DEST pdfmark"}

and in the source file I point to that named destination with:

{PRINT \p para "[ /Rect [ wp$box pathbbox ] /Border [ 0 0 0 ] /Action /GoToR
/Dest /My_Target_1 /File (Pub/Fiche test.pdf) /Subtype /Link /ANN pdfmark"}

Everything worked under Acrobat 5, when I clicked on the source
paragraph,
I
was brought to the 3rd page of the ressource document (Where the named
destinataion given above is located).
Now it takes me to the document allright, but I am always stuck on the first
page. I have several named destination and all the links behave the same
way.

I tried changing all kinds of options in the Acrobat settings, to no avail.
I tried the Distiller options and this Word Compatibility option: “Use
Printer Metrics to Layout Document” . Actually, this last one had to be
checked with Acrobat 5, but with 6, if I uncheck it, it takes one of the
annotation an makes it "hot" on the whole page... so it still needs to be
checked with Acrobat 6.

Any clues as to what I am doing wrong?

Yes. Its quite simple, you have forgotton to include the /Page parameter in
your definition of a named destination. If your example is supposed to take
you to page 3, it should be as follows

{PRINT \p para "[ /Dest /My_Target_1 /Page 3 /View [ /FitB] /DEST pdfmark"}

In fact, I'm mildly surprised it worked even under Acrobat 5, and also
mildly surprised that the links were in the right place even if they were
pointing to the wrong page, because you have also left out the /SrcPg
parameter from the link definitions. I rather think that your link
definition should be as follows (assumes the link is on page 2 of the source
document)

{PRINT \p para "[ /SrcPg 2 /Rect [ wp$box pathbbox ] /Border [ 0 0 0 ]
/Action /GoToR /Dest /My_Target_1 /File (Pub/Fiche test.pdf) /Subtype /Link
/ANN pdfmark"}


--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup
 
J

JGM

Hi again!

A grand finale for this saga...

I downloaded the latest pdate (Came out November 3 2003) from Adobe's ftp
site.

They finally got their stuff together and fixed the bug.

But, still, if you happen to know the answer to may question about forcing a
new window or if you kow about Web sources regarding "unofficial" pdfmark
and associated code (like wp$box pathbbox) then I would certainly appreciate
it.

Thanks for all your help and have a great week-end!
(I know I will now that I sorted out this whole mess!)

Cheers!

--
_______________________________________
Jean-Guy Marcil
(e-mail address removed)

Jonathan West said:
JGM said:
Hi Jonathan,

Just when I was very proud of having achieved all that I wanted in just less
than a day... something came up!

I talked to my client and learned that he has not yet purchased Acrobat. So
he is going to get Acrobat 6. I tought to myself: "I'd better get it too!"
So I did. Uninstalled 5 and put in 6. Ran my batch macro and it worked
flawlessly, including the skipping of asking the name for each file... Just
as you said it would.

Then I opened my new PDF files in my new Acrobat 6 and was amazed by all the
glitters! But not by the way it behaved! Bad boy!

Here it is:
I have source files that points to a ressource files that contains hundreds
of pages of definitions and descriptions that my client does not want in the
main text (the source files).
So in the ressourcs files, I have included, for example, the following
pdfmark:

{PRINT \p para "[ /Dest /My_Target_1 /View [ /FitB] /DEST pdfmark"}

and in the source file I point to that named destination with:

{PRINT \p para "[ /Rect [ wp$box pathbbox ] /Border [ 0 0 0 ] /Action /GoToR
/Dest /My_Target_1 /File (Pub/Fiche test.pdf) /Subtype /Link /ANN pdfmark"}

Everything worked under Acrobat 5, when I clicked on the source
paragraph,
I
was brought to the 3rd page of the ressource document (Where the named
destinataion given above is located).
Now it takes me to the document allright, but I am always stuck on the first
page. I have several named destination and all the links behave the same
way.

I tried changing all kinds of options in the Acrobat settings, to no avail.
I tried the Distiller options and this Word Compatibility option: “Use
Printer Metrics to Layout Document” . Actually, this last one had to be
checked with Acrobat 5, but with 6, if I uncheck it, it takes one of the
annotation an makes it "hot" on the whole page... so it still needs to be
checked with Acrobat 6.

Any clues as to what I am doing wrong?

Yes. Its quite simple, you have forgotton to include the /Page parameter in
your definition of a named destination. If your example is supposed to take
you to page 3, it should be as follows

{PRINT \p para "[ /Dest /My_Target_1 /Page 3 /View [ /FitB] /DEST pdfmark"}

In fact, I'm mildly surprised it worked even under Acrobat 5, and also
mildly surprised that the links were in the right place even if they were
pointing to the wrong page, because you have also left out the /SrcPg
parameter from the link definitions. I rather think that your link
definition should be as follows (assumes the link is on page 2 of the source
document)

{PRINT \p para "[ /SrcPg 2 /Rect [ wp$box pathbbox ] /Border [ 0 0 0 ]
/Action /GoToR /Dest /My_Target_1 /File (Pub/Fiche test.pdf) /Subtype /Link
/ANN pdfmark"}


--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top