ReportToPDF-Merge Distortions

R

RobGMiller

Using Stephen Leban's ReportToPDF with Access 2003

In some cases, merging two PDFs created with ConvertUncompressedSnapshot
programatically will cause distortions. Operates differently with different
versions of Acrobat I believe.

A simple test merging two PDFs using Acrobat.CAcroPDDoc object will create
distortions. The second PDF might not be there and the first will be modified
by the merge process.

If the two are merged manually using Acrobat by opening the first one and
attempting to import the second one (document/insertpages) an error message
is displayed as follows.

These documents contain subset fonts that have the same name and cannot be
merged.

Further investigation on Adobe
(http://kb.adobe.com/selfservice/viewContent.do?externalId=327594) suggests
"re-create the PDF file with the fonts fully embedded, or without the font
embedded at all"

The ConvertUncompressedSnapshot function exposed by strStorage.dll included
with the ReportToPDF code does have a parameter to specify weather or not to
embed the fonts. If the PDFNoFontEmbedding parameter is set to 0, the files
are never merged properly with some versions of Acrobat. If it is set to 1
then the files are merged properly only every second time.

I was not able to find a full explanation of how the
ConvertUncompressedSnapshot function works and I was wondering if anyone had
encountered a similar issue or has more information on the
ConvertUncompressedSnapshot function.


Thanks
 
R

RobGMiller

Hi Stephen,

As I say, I works well on other computers. Its probably related to the
version of Acrobat API which is 5.0 on the one that doesn't work. It seems to
work with Acrobat 7.

In any case, I gather that you are the author of the strStorage.dll that is
included with ReportToPDF. If so, can you tell me if the value of the
ConvertUncompressedSnapshot PDFNoFontEmbedding parameter should be to fully
imbed all the fonts as Adobe suggests. Perhaps it might help. I've tried 0, 1
and -1 so far. (-1 seems to have the same effect as 1).


Here is the Acrobat merge code you requested.

Function Merge()
Dim objAcroApp As Acrobat.CAcroApp
Dim objAcroDoc As Acrobat.CAcroPDDoc
Dim objAcroDocSrc As Acrobat.CAcroPDDoc
Dim lngRetVal As Long
Dim i As Long
Dim lngPage As Long

Set objAcroApp = CreateObject("AcroExch.App")
Set objAcroDoc = CreateObject("AcroExch.PDDoc")
Set objAcroDocSrc = CreateObject("AcroExch.PDDoc")

lngRetVal = objAcroDoc.Open(colDOCS.Item(1))
lngPage = objAcroDoc.GetNumPages

For i = 2 To colDOCS.Count
lngRetVal = objAcroDocSrc.Open(colDOCS.Item(i))
Merge = objAcroDoc.InsertPages((lngPage - 1), objAcroDocSrc, 0,
objAcroDocSrc.GetNumPages, False)
lngPage = lngPage + objAcroDocSrc.GetNumPages
objAcroDocSrc.Close
Next i
objAcroDoc.CreateThumbs 0, lngPage - 1
Merge = objAcroDoc.Save(PDSaveFull, strDestination)

objAcroDoc.Close
objAcroApp.Exit
If Not objAcroApp Is Nothing Then Set objAcroApp = Nothing
If Not objAcroDoc Is Nothing Then Set objAcroDoc = Nothing
If Not objAcroDocSrc Is Nothing Then Set objAcroDocSrc = Nothing

End Function

By the way, the ReportToPDF is a great help to me and I suspect any Access
developer who needs to send a report to PDF. I thank you for that and for
your interest in this issue.
 
R

RobGMiller

I did read about that and corrected it but it made no difference.

I am guessing that even though PDFNoFontEmbedding is declared as a long it
is treated as a boolean? Meaning the choices are (0) or (-1). In that case,
neither one produced a file that can consistently be merged by, (lets say
probably), Acrobat 5.

Will you be releasing the merge functionality under the same licensing
arrangement as the previous release of ReportToPDF code?

If so, I am looking forward to trying it out.

Thanks again for your help Stephan.
 

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