void IResourceSavingCallback.ResourceSaving(ResourceSavingArgs args) { // If we set a folder alias in the SaveOptions object, it will be printed here Console.WriteLine($"Resource #{++mSavedResourceCount} \"{args.ResourceFileName}\""); string extension = Path.GetExtension(args.ResourceFileName); switch (extension) { case ".ttf": case ".woff": { // By default 'ResourceFileUri' used system folder for fonts // To avoid problems across platforms you must explicitly specify the path for the fonts args.ResourceFileUri = ArtifactsDir + Path.DirectorySeparatorChar + args.ResourceFileName; break; } } Console.WriteLine("\t" + args.ResourceFileUri); // If we specified a ResourcesFolderAlias we will also need to redirect each stream to put its resource in that folder args.ResourceStream = new FileStream(args.ResourceFileUri, FileMode.Create); args.KeepResourceStreamOpen = false; }
/// <summary> /// Called when Aspose.Words saves an external resource to fixed page HTML or SVG. /// </summary> public void ResourceSaving(ResourceSavingArgs args) { mText.AppendLine($"Original document URI:\t{args.Document.OriginalFileName}"); mText.AppendLine($"Resource being saved:\t{args.ResourceFileName}"); mText.AppendLine($"Full uri after saving:\t{args.ResourceFileUri}\n"); }
void IResourceSavingCallback.ResourceSaving(ResourceSavingArgs args) { Console.WriteLine($"Resource #{++mSavedResourceCount} \"{args.ResourceFileName}\""); Console.WriteLine("\t" + args.ResourceFileUri); }
void IResourceSavingCallback.ResourceSaving(ResourceSavingArgs args) { // If we set a folder alias in the SaveOptions object, it will be printed here Console.WriteLine($"Resource #{++mSavedResourceCount} \"{args.ResourceFileName}\""); Console.WriteLine("\t" + args.ResourceFileUri); }