Quantcast
Channel: Adobe Community: Message List - Acrobat SDK
Viewing all articles
Browse latest Browse all 10848

Embed Barcode Fonts for Watermark

$
0
0

I hope someone could help me with this:

 

I need to add a barcode to a scanned image pdf file. This file will be viewed by a number of users on their workstations. Therefore the barcode font has to be embedded to the newly created pdf file.

 

I used the following VB.Net code to add the watermark:

 

Dim jsObj As Object

Dim SamplePDFFilePath As String = "c:\inputFile.pdf"

Dim OutputFilePath As String = "c:\outputFile.pdf"

 

' Create a PDDoc IAC object.

Dim pdDoc As Acrobat.CAcroPDDoc

pdDoc = CreateObject("AcroExch.PDDoc")

 

' Open the source PDF document

Dim rc As Integer

rc = pdDoc.Open(SamplePDFFilePath)

 

' Acquire the Acrobat JavaScript Object interface from the PDDoc object

jsObj = pdDoc.GetJSObject

 

' make a color object

Dim oColor As Object

oColor = jsObj.color.black()

 

' Add a text watermark.

' function prototype:

'   addWatermarkFromText(cText, nTextAlign, cFont, nFontSize, oColor, nStart, nEnd, bOnTop, bOnScreen, bOnPrint, nHorizAlign, nVertAlign, nHorizValue, nVertValue, bPercentage, nScale, bFixedPrint, nRotation, nOpacity)

jsObj.addWatermarkFromText("12345678", 1, "BarcodeFontName", 26, oColor, 0, 0, True, True, True, 0, 3, 100, -7, False, 1.0, False, 0, 1)

 

' save the PDF with watermarks to a new document.

rc = pdDoc.Save(1, OutputFilePath)  ' full save

 

This works. However the font is not embedded.

I am using Acrobat X.

 

My questions:

1. How to embed the barcode font to the newly created pdf file using VB code?

 

2. I have tried to add an additional watermark from a pdf file using this function: addWatermarkFromFile(cDIPath, nSourcePage, nStart, nEnd, bOnTop, bOnScreen, bOnPrint, nHorizAlign, nVertAlign, nHorizValue, nVertValue, bPercentage, nScale, bFixedPrint, nRotation, nOpacity). The file is a pdf containing a small graphic image. I notice after I added this image pdf as watermark, the barcode font is embedded in the new pdf file. Is this an Acrobat design? But the strange thing is that I removed the addWatermarkFromFile() function from my code and recompiled it. The graphic is not included in the new pdf file, but the font is still embedded. I wonder why Acrobat still embeds the barcode font. Is this a normal behaviour of Acrobat?

 

3. I have read a posting that addWatermarkAsText() function will always embed the font. But I am not able to find this function in the SDK 10. Is this function obsolete?

 

Any help is appreciated.


Viewing all articles
Browse latest Browse all 10848

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>