• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Reduce Disk Space taken up by watermark

Community Beginner ,
Jul 26, 2022 Jul 26, 2022

Copy link to clipboard

Copied

Hi Everyone!

 

I've been using the debbugger to write a JavaScrip code that makes it easier to add a unique watermark to a document. One issue I'm running into is the file becomes mich larger in size. The test file starts out as 36kb and after I save it with the watermark its 486KB and another code its 492KB Dos anyone have any ideas to fix it? 

watermark.PNG

TOPICS
JavaScript

Views

478

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 26, 2022 Jul 26, 2022

Copy link to clipboard

Copied

In Adobe Acrobat Pro, you have a tool to figure out what featues in a PDF file are using how much space. You can find this "Audit space usage" feature when you select to save the file as an Optimized PDF (File>Save as Other>Optimized PDF). It's very likely that this is caused by an embedded font. Have you tried to use a different font to see if this keeps the file size down? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 26, 2022 Jul 26, 2022

Copy link to clipboard

Copied

Hi Karl!

 

I really apprciate the help. I tried saving the file as an Optimized PDF. Here is a screenshot of the embeded fonts. Should I get rid of them?

 

optimized font.PNG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2022 Jul 27, 2022

Copy link to clipboard

Copied

It depends on what feature in the PDF uses up the most space. If the subset embedded font is not a big contributor to the total size, then I would not touch it. Subset embedded means that only those glyphs (the drawings of the characters) that are actually used in the file are embedded, so that keeps the size down already. Did you run the space audit function? What did it report? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 27, 2022 Jul 27, 2022

Copy link to clipboard

Copied

You were right. It looks like 97.5% is taken up by the fonts. Any suggestions to reduce that?

space audit.PNG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2022 Jul 27, 2022

Copy link to clipboard

Copied

In general, it's a good idea to leave the subset embedded font in the file. This way, you can display this file regardless of which fonts are installed on a system. If you don't think this is necessary, you can remove the embedded font using the "Save as optimized PDF" function. Give that a try and see what the resulting file size is. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 27, 2022 Jul 27, 2022

Copy link to clipboard

Copied

I just tried saving it without the font and the file went from 492KB to 486KB, so not a big change. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

Does the modified file still list this font as embedded? What else do you have in the file? Are there any form fields? That could explain why the font size did not go down: Fonts that are embedded for use in form fields are treated differently, and the only way to get rid of that overhead is to switch to one of the standard PDF fonts (e.g. Helvetica, Times Roman or Courier). 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

Its showing Arial and Calibri as embeded fonts. I do use app.response to prompt the user to enter what they want the watermark to be. Those are the only 2 fonts available when I try saving it as an optimized PDF. Is there a way to add Helvetica, Times Roman or Courier? If I save the file with no embeded fonts then the size goes way down. 

embedded fonts.PNG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

You should be able to remove Arial without a problem, this font (or Helvetica) should be available on any system. If you can change the text set in Calibri to one of the standard fonts, then you need to embed that either. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

Is there a way to autosave it without the embeded fonts using JavaScript. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

Change your code to use a different font for the watermark text, preferably one that's available in the application itself (basically everything that can be referred to via the font object by name, such as font.Helv or font.Times).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 03, 2022 Aug 03, 2022

Copy link to clipboard

Copied

LATEST

Thank you! That worked. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines