Code Monkey home page Code Monkey logo

Comments (11)

RavishaHesh avatar RavishaHesh commented on May 29, 2024

Try setting this to "Fast"

pageImageCompression: "MEDIUM", // FAST, MEDIUM, SLOW(Helps to control the new PDF file size)

from pdfjsannotations.

vavicheth avatar vavicheth commented on May 29, 2024

Thanks for your advice.
It's nothing change size. When I change the scale to 1 (scale: 1), It's smaller but my pdf file smaller than paper (as padding).

from pdfjsannotations.

RavishaHesh avatar RavishaHesh commented on May 29, 2024

Scaling is similar to zoom function, but pageImageCompression sets the compression level of images of each page.

from pdfjsannotations.

vavicheth avatar vavicheth commented on May 29, 2024

I tried to change pageImageCompression: "FAST", // FAST, MEDIUM, SLOW(Helps to control the new PDF file size) but It still big size.

from pdfjsannotations.

hichamhargal avatar hichamhargal commented on May 29, 2024

Try this solution

from pdfjsannotations.

kalana85 avatar kalana85 commented on May 29, 2024

Now pdf files save as an image. (Image inside pdf file). Can we make save it as normal pdf. (I mean as selectable text format. Not images in pdf).?

from pdfjsannotations.

RavishaHesh avatar RavishaHesh commented on May 29, 2024

@kalana85 It's possible but requires little bit of time to go through the documentations and stuff. I've started to work on that and haven't had time to work on that for last few months. You can find it in the dev branch. Last time I worked on that I was stuck in something related to the fonts.

from pdfjsannotations.

bzxgcs avatar bzxgcs commented on May 29, 2024

@ kalana85这是可能的,但需要一点时间来浏览文档和内容。我已经开始做这件事,但在过去几个月里一直没有时间做这件事。您可以在 dev 分支中找到它。上次我工作时遇到了与字体相关的问题。

If it is difficult, could you save annotation data in a single file? Then we can add annotation to pdf by other backend(such as python).

from pdfjsannotations.

fewbackseven avatar fewbackseven commented on May 29, 2024

The issue still persists even after disabling retinascaling in pdfannotate.js
The file gets 4 times bigger and the quality is lost.
.
.
Let me know if there are any other solution for this issue?
thanks

from pdfjsannotations.

fewbackseven avatar fewbackseven commented on May 29, 2024

did anyone find the solution?

from pdfjsannotations.

fewbackseven avatar fewbackseven commented on May 29, 2024

Yes.. The solution here worked for me.
After disabling the Retinascaling, Assigning Imagecompression to 'FAST', I restricted the page size to A4 while saving the pdf.
Please refer below code..

PDFAnnotate.prototype.savePdf = function (fileName) {
debugger;
var inst = this;
//var format = inst.format || 'a4';
var format = 'a4'; //<------------ Restricted the page size to A4 here by addling this line in pdfannotate.js
var orientation = inst.orientation || 'portrait';
if (!inst.fabricObjects.length) return;
debugger;

var doc = new jspdf.jsPDF({ format, orientation });
if (typeof fileName === 'undefined') {
fileName = ${new Date().getTime()}.pdf;
PDFAnnotate.prototype.savePdf = function (fileName) {
debugger;
var inst = this;
//var format = inst.format || 'a4';
var format = 'a4'; //<------------ Restricted the page size to A4 here by addling this line in pdfannotate.js
var orientation = inst.orientation || 'portrait';
if (!inst.fabricObjects.length) return;
debugger;

var doc = new jspdf.jsPDF({ format, orientation });
if (typeof fileName === 'undefined') {
fileName = ${new Date().getTime()}.pdf;
}

from pdfjsannotations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.