PDF-XChange - Tracker PDF Viewer - TIFF-XChange - Image-XChange - XMF-XChange - Raster-XChange - Support

Moderators: Tracker Support, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
 
vivekpatel
User
Topic Author
Posts: 138
Joined: Sat Aug 27, 2016 11:00 am

WaterMark not added to file.

Sat Aug 12, 2017 11:45 am

Hello,
I'm using pdfcontrol to do watermark document without open document in control.

Here is my code:

Public rc As PDFXEdit.PXC_Rect


Public m_Inst As PDFXEdit.PXV_Inst = Nothing
Public m_pxcInst As PDFXEdit.IPXC_Inst = Nothing
Public ixcInst As PDFXEdit.IIXC_Inst = Nothing
Public IAUX_Inst As PDFXEdit.IAUX_Inst = Nothing

Public Sub InitPDFControl()
Try

Dim licKey As String = "xyz"
m_Inst = New PDFXEdit.PXV_Inst()
m_Inst.Init(Nothing, licKey, Nothing, Nothing, Nothing, 0, Nothing)
m_pxcInst = CType(m_Inst.GetExtension("PXC"), PDFXEdit.IPXC_Inst)
IAUX_Inst = m_Inst.GetExtension("AUX")

Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Private Sub Btnwtrmrk_Click(sender As Object, e As EventArgs) Handles Btnwtrmrk.Click
Try
Dim doc As PDFXEdit.IPXC_Document
InitPDFControl()

doc = m_pxcInst.OpenDocumentFromFile("C:\Users\Vivek\Desktop\Pages from Untitled.pdf", Nothing) 'open doc
'PlaceWatermark(doc, m_pxcInst)

Dim bs As PDFXEdit.IBitSet = IAUX_Inst.CreateBitSet(doc.Pages.Count)
Dim wp As PDFXEdit.IPXC_WatermarkParams = m_pxcInst.CreateWatermarkParams()

bs.Set(0, doc.Pages.Count)
wp.Text = "dddddddddddddfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
wp.Scale = 200
wp.FontSize = Convert.ToSingle(50)
wp.FontName = "Book Antiqua"
wp.WatermarkType = PDFXEdit.PXC_WatermarkType.Watermark_Text
doc.PlaceWatermark(bs, wp)

Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Code works fine, but document not watermarked.
so what to do?
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 2489
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: WaterMark not added to file.

Sun Aug 13, 2017 7:07 am

Hello vivekpatel,

Try commenting this wp.FontName = "Book Antiqua" and see whether this works.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
 
vivekpatel
User
Topic Author
Posts: 138
Joined: Sat Aug 27, 2016 11:00 am

Re: WaterMark not added to file.

Mon Aug 14, 2017 5:50 am

Hello and thanks,

i did as you suggest, but not working for me.
Here i'm attaching my sample to figure out prob.
Rgds,
Attachments
WindowsApplication14.rar
(453.21 KiB) Downloaded 5 times
 
User avatar
Sasha - Tracker Dev Team
User
Posts: 2489
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: WaterMark not added to file.

Mon Aug 14, 2017 8:04 am

Hello vivekpatel,

Well from what I see you are not writing the changes to the document - that's all.
doc.WriteTo(null);
doc.Close();


Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Who is online

Users browsing this forum: No registered users and 1 guest