Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
RenderDocumentToFile with transparent images |
Post Reply ![]() |
Author | |
bbenc ![]() Beginner ![]() Joined: 20 Dec 19 Location: Australia Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() Posted: 06 Jan 20 at 6:01AM |
I originally posted same topic but it hasn't been resolved and my trial expires soon and I need to know if this product will meet my needs (hence the new post): I am trying to add a watermark (transparent image) to a image file. Below is some basic code to show that you can create a pdf with watermarks but using the same code it does not produce the same results when creating an image file (.SaveToFile vs .RenderDocumentToFile). The image file (.RenderDocumentToFile) only shows the overlaid image with 0 transparency. Can anyone please help me create an image file with transparent images? strImportFolder = "E:\FOXIT\Testing"
strImportFile = "IMG_3560" strImportFileExt = "jpg" strWMFolder = "E:\FOXIT\Testing" strWMFile = "TestWM" strWMFileExt = "jpg" strExportFolder = "E:\FOXIT\Testing\" strExportFile = "Image_3560" strExportFileExt = "jpg" dblPage = 1 dblTransparency = 90 Set objPDF = CreateObject(gcstrPDFLibrary) If objPDF.UnlockKey(gcstrPDFLicense) = 1 Then Call objPDF.AddImageFromFile(strImportFolder & "\" & strImportFile & "." & strImportFileExt, 0) dblWidth = objPDF.ImageWidth() dblHeight = objPDF.ImageHeight() ret = objPDF.SetPageDimensions(dblWidth, dblHeight) ret = objPDF.DrawImage(0, dblHeight, dblWidth, dblHeight) ret = objPDF.SelectPage(dblPage) ret = objPDF.NormalizePage(0) ret = objPDF.SetOrigin(1) dblContentStream = objPDF.NewContentStream ret = objPDF.SelectContentStream(dblContentStream) ret = objPDF.SaveState dblWMImageID = objPDF.AddImageFromFile(strWMFolder & "\" & strWMFile & "." & strWMFileExt, 0) ret = objPDF.SelectImage(dblWMImageID) ret = objPDF.SetTransparency(dblTransparency) ret = objPDF.DrawImage(0, 0, objPDF.PageWidth, objPDF.PageHeight) ret = objPDF.LoadState ret = objPDF.MoveContentStream(dblContentStream, objPDF.ContentStreamCount) Call objPDF.CombineContentStreams ret = objPDF.SaveToFile(strExportFolder & "\" & strExportFile & ".pdf") ret = objPDF.RenderDocumentToFile(300, 1, 1, 1, strExportFolder & "\" & strExportFile & "." & strExportFileExt) End If Set objPDF = Nothing Edited by bbenc - 06 Jan 20 at 6:11AM |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
QuickPDF embeds several image-/render libraries for rendering. These libraries themself are offering a lot of more functionalities - your transparency-options as well. QuickPDF is for pdf - Render libraries are more for images ;-) The described special needs you won't feed with the actual version of QuickPDF. For this issue you should dive deeper into the libraries like Cairo, PDFium, GDI+ or AGG. |
|
Cheers,
Ingo |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store