Hi,
I am using GleamTech DocumentUltimate (7.6.6).
When I load a document from a static file path, the file is displayed correctly and caching works as expected.
However, when I load the document from an API or a SQL query, I notice that two cache PDFs are created in the cache location. These duplicate cache files are not created when using the static file path option.
Is this the expected behavior when using API or query-based document loading? If not, how can I avoid duplicate cache PDFs from being generated?
Thank You.
For instance when you change watermark options, both Pdf and Xpz outputs are regenerated. By default the Pdf and Xpz outputs are replaced in cache when watermarks are changed. If you set this property to true, the Pdf and Xpz outputs will not be replaced but all variations will be kept in cache instead. This can be useful especially when you want different outputs for different users. So this way, for instance you can have different watermarked variations for each different user.
public override string File { get; set; } public override bool CanGetInfo => true; public override bool CanOpenRead => true; public override bool CanOpenWrite => false; public override bool CanSerialize => false; protected override FileProviderInfo DoGetInfo() { byte[] fileContent = new byte[0]; DateTime lastModified = DateTime.UtcNow; string sql = string.Format(selectCommand, parentKey); var dataSet = DataServiceBase.ExecuteDataset(connectionString, CommandType.Text, sql); if (dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0) { if (isFileNameMapped) { this.File = dataSet.Tables[0].Rows[0][fileName].ToString(); } if (mustBase64Decode) { fileContent = Convert.FromBase64String(dataSet.Tables[0].Rows[0][fileContentsField].ToString()); } else { fileContent = (byte[])dataSet.Tables[0].Rows[0][fileContentsField]; } } return new FileProviderInfo(this.File, lastModified, fileContent?.LongLength ?? 0); } protected override Stream DoOpenRead() { byte[] fileContent = new byte[0]; string sql = string.Format(selectCommand, parentKey); var dataSet = DataServiceBase.ExecuteDataset(connectionString, CommandType.Text, sql); if (dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0) { if (mustBase64Decode) { fileContent = Convert.FromBase64String(dataSet.Tables[0].Rows[0][fileContentsField].ToString()); } else { fileContent = (byte[])dataSet.Tables[0].Rows[0][fileContentsField]; } } return new MemoryStream(fileContent); }
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add notify@gleamtech.com to your trusted senders list in your email software.